@camstack/types 0.1.41 → 0.2.0
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 +0 -1
- package/dist/addon/build-addon-route-provider.d.ts +0 -1
- package/dist/addon/durable-state.d.ts +0 -1
- package/dist/capabilities/accessories.cap.d.ts +0 -1
- package/dist/capabilities/addon-pages-source.cap.d.ts +0 -1
- package/dist/capabilities/addon-pages.cap.d.ts +0 -1
- package/dist/capabilities/addon-routes.cap.d.ts +0 -1
- package/dist/capabilities/addon-settings.cap.d.ts +0 -1
- package/dist/capabilities/addon-widgets-source.cap.d.ts +0 -1
- package/dist/capabilities/addon-widgets.cap.d.ts +0 -1
- package/dist/capabilities/addons.cap.d.ts +0 -1
- package/dist/capabilities/admin-ui.cap.d.ts +0 -1
- package/dist/capabilities/advanced-notifier.cap.d.ts +0 -1
- package/dist/capabilities/air-quality-sensor.cap.d.ts +0 -1
- package/dist/capabilities/alarm-panel.cap.d.ts +0 -1
- package/dist/capabilities/alerts.cap.d.ts +0 -1
- package/dist/capabilities/ambient-light-sensor.cap.d.ts +0 -1
- package/dist/capabilities/audio-analysis.cap.d.ts +0 -1
- package/dist/capabilities/audio-analyzer.cap.d.ts +1 -2
- package/dist/capabilities/audio-codec.cap.d.ts +0 -1
- package/dist/capabilities/audio-metrics.cap.d.ts +0 -1
- package/dist/capabilities/auth-provider.cap.d.ts +0 -1
- package/dist/capabilities/automation-control.cap.d.ts +0 -1
- package/dist/capabilities/backup.cap.d.ts +0 -1
- package/dist/capabilities/battery.cap.d.ts +0 -1
- package/dist/capabilities/binary.cap.d.ts +0 -1
- package/dist/capabilities/brightness.cap.d.ts +0 -1
- package/dist/capabilities/broker.cap.d.ts +0 -1
- package/dist/capabilities/button.cap.d.ts +0 -1
- package/dist/capabilities/camera-credentials.cap.d.ts +0 -1
- package/dist/capabilities/camera-pipeline-config.cap.d.ts +0 -1
- package/dist/capabilities/camera-streams.cap.d.ts +0 -1
- package/dist/capabilities/capability-definition.d.ts +0 -1
- package/dist/capabilities/carbon-monoxide.cap.d.ts +0 -1
- package/dist/capabilities/climate-control.cap.d.ts +0 -1
- package/dist/capabilities/color.cap.d.ts +0 -1
- package/dist/capabilities/connectivity.cap.d.ts +0 -1
- package/dist/capabilities/consumables.cap.d.ts +0 -1
- package/dist/capabilities/contact.cap.d.ts +0 -1
- package/dist/capabilities/control.cap.d.ts +0 -1
- package/dist/capabilities/cover.cap.d.ts +0 -1
- package/dist/capabilities/custom-actions.d.ts +0 -1
- package/dist/capabilities/decoder.cap.d.ts +0 -1
- package/dist/capabilities/detection-pipeline.cap.d.ts +0 -1
- package/dist/capabilities/device-adoption.cap.d.ts +0 -1
- package/dist/capabilities/device-discovery.cap.d.ts +0 -1
- package/dist/capabilities/device-export.cap.d.ts +0 -1
- package/dist/capabilities/device-manager.cap.d.ts +1 -2
- package/dist/capabilities/device-ops.cap.d.ts +0 -1
- package/dist/capabilities/device-provider.cap.d.ts +0 -1
- package/dist/capabilities/device-state.cap.d.ts +0 -1
- package/dist/capabilities/device-status.cap.d.ts +0 -1
- package/dist/capabilities/doorbell.cap.d.ts +0 -1
- package/dist/capabilities/embedding-encoder.cap.d.ts +0 -1
- package/dist/capabilities/enum-sensor.cap.d.ts +0 -1
- package/dist/capabilities/event-emitter.cap.d.ts +0 -1
- package/dist/capabilities/events.cap.d.ts +0 -1
- package/dist/capabilities/face-gallery.cap.d.ts +157 -0
- package/dist/capabilities/fan-control.cap.d.ts +0 -1
- package/dist/capabilities/feature-probe.cap.d.ts +0 -1
- package/dist/capabilities/filesystem-browse.cap.d.ts +38 -0
- package/dist/capabilities/flood.cap.d.ts +0 -1
- package/dist/capabilities/gas.cap.d.ts +0 -1
- package/dist/capabilities/humidifier.cap.d.ts +0 -1
- package/dist/capabilities/humidity-sensor.cap.d.ts +0 -1
- package/dist/capabilities/image.cap.d.ts +0 -1
- package/dist/capabilities/index.d.ts +56 -51
- package/dist/capabilities/integrations.cap.d.ts +0 -1
- package/dist/capabilities/intercom.cap.d.ts +0 -1
- package/dist/capabilities/lawn-mower-control.cap.d.ts +0 -1
- package/dist/capabilities/local-network.cap.d.ts +0 -1
- package/dist/capabilities/lock-control.cap.d.ts +0 -1
- package/dist/capabilities/log-destination.cap.d.ts +0 -1
- package/dist/capabilities/mask-shape.d.ts +0 -1
- package/dist/capabilities/media-player.cap.d.ts +0 -1
- package/dist/capabilities/mesh-network.cap.d.ts +0 -1
- package/dist/capabilities/metrics-provider.cap.d.ts +0 -1
- package/dist/capabilities/motion-detection.cap.d.ts +0 -1
- package/dist/capabilities/motion-trigger.cap.d.ts +0 -1
- package/dist/capabilities/motion-zones.cap.d.ts +0 -1
- package/dist/capabilities/motion.cap.d.ts +0 -1
- package/dist/capabilities/mqtt-broker.cap.d.ts +0 -1
- package/dist/capabilities/native-object-detection.cap.d.ts +0 -1
- package/dist/capabilities/network-access.cap.d.ts +0 -1
- package/dist/capabilities/network-quality.cap.d.ts +1 -2
- package/dist/capabilities/nodes.cap.d.ts +0 -1
- package/dist/capabilities/notification-output.cap.d.ts +0 -1
- package/dist/capabilities/notifier.cap.d.ts +0 -1
- package/dist/capabilities/numeric-sensor.cap.d.ts +0 -1
- package/dist/capabilities/oauth-integration.cap.d.ts +0 -1
- package/dist/capabilities/osd.cap.d.ts +0 -1
- package/dist/capabilities/pipeline-analytics.cap.d.ts +69 -2
- package/dist/capabilities/pipeline-executor.cap.d.ts +0 -1
- package/dist/capabilities/pipeline-orchestrator.cap.d.ts +0 -1
- package/dist/capabilities/pipeline-runner.cap.d.ts +4 -1
- package/dist/capabilities/plate-gallery.cap.d.ts +100 -0
- package/dist/capabilities/platform-probe.cap.d.ts +0 -1
- package/dist/capabilities/power-meter.cap.d.ts +0 -1
- package/dist/capabilities/presence.cap.d.ts +0 -1
- package/dist/capabilities/pressure-sensor.cap.d.ts +0 -1
- package/dist/capabilities/privacy-mask.cap.d.ts +0 -1
- package/dist/capabilities/ptz-autotrack.cap.d.ts +0 -1
- package/dist/capabilities/ptz.cap.d.ts +1 -2
- package/dist/capabilities/reboot.cap.d.ts +0 -1
- package/dist/capabilities/recording.cap.d.ts +191 -1
- package/dist/capabilities/restreamer.cap.d.ts +0 -1
- package/dist/capabilities/schemas/detection-shared.d.ts +0 -1
- package/dist/capabilities/schemas/orchestrator-metrics.d.ts +0 -1
- package/dist/capabilities/schemas/streaming-shared.d.ts +0 -1
- package/dist/capabilities/schemas/zone-rule.d.ts +0 -1
- package/dist/capabilities/script-runner.cap.d.ts +0 -1
- package/dist/capabilities/settings-store.cap.d.ts +0 -1
- package/dist/capabilities/smoke.cap.d.ts +0 -1
- package/dist/capabilities/smtp-provider.cap.d.ts +0 -1
- package/dist/capabilities/snapshot-provider.cap.d.ts +0 -1
- package/dist/capabilities/snapshot.cap.d.ts +0 -1
- package/dist/capabilities/sso-bridge.cap.d.ts +0 -1
- package/dist/capabilities/storage-evictable.cap.d.ts +0 -1
- package/dist/capabilities/storage-provider.cap.d.ts +15 -1
- package/dist/capabilities/storage.cap.d.ts +6 -1
- package/dist/capabilities/stream-broker.cap.d.ts +16 -1
- package/dist/capabilities/stream-catalog.cap.d.ts +0 -1
- package/dist/capabilities/stream-params-config-schema.d.ts +0 -1
- package/dist/capabilities/stream-params.cap.d.ts +0 -1
- package/dist/capabilities/streaming-engine.cap.d.ts +0 -1
- package/dist/capabilities/switch.cap.d.ts +0 -1
- package/dist/capabilities/system.cap.d.ts +1 -2
- package/dist/capabilities/tamper.cap.d.ts +0 -1
- package/dist/capabilities/temperature-sensor.cap.d.ts +0 -1
- package/dist/capabilities/toast.cap.d.ts +0 -1
- package/dist/capabilities/turn-provider.cap.d.ts +1 -2
- package/dist/capabilities/update.cap.d.ts +0 -1
- package/dist/capabilities/user-management.cap.d.ts +0 -1
- package/dist/capabilities/user-passkeys.cap.d.ts +1 -2
- package/dist/capabilities/vacuum-control.cap.d.ts +0 -1
- package/dist/capabilities/valve.cap.d.ts +0 -1
- package/dist/capabilities/vibration.cap.d.ts +0 -1
- package/dist/capabilities/videoclips.cap.d.ts +76 -0
- package/dist/capabilities/water-heater.cap.d.ts +0 -1
- package/dist/capabilities/weather.cap.d.ts +0 -1
- package/dist/capabilities/webrtc-session.cap.d.ts +0 -1
- package/dist/capabilities/webrtc.cap.d.ts +0 -1
- package/dist/capabilities/zone-analytics.cap.d.ts +0 -1
- package/dist/capabilities/zone-rules.cap.d.ts +0 -1
- package/dist/capabilities/zones.cap.d.ts +0 -1
- package/dist/catalogs/audio-classmap.d.ts +0 -1
- package/dist/catalogs/coco-classmap.d.ts +0 -1
- package/dist/catalogs/index.d.ts +0 -1
- package/dist/constants.d.ts +1 -2
- package/dist/deps/binary-downloader.d.ts +0 -1
- package/dist/deps/ffmpeg-downloader.d.ts +0 -1
- package/dist/deps/index.d.ts +1 -2
- package/dist/deps/python-downloader.d.ts +0 -1
- package/dist/device/accessory.d.ts +1 -2
- package/dist/device/base-device-provider.d.ts +0 -1
- package/dist/device/base-device.d.ts +0 -1
- package/dist/device/camera-device.d.ts +0 -1
- package/dist/device/device-binding.d.ts +0 -1
- package/dist/device/device-config.d.ts +0 -1
- package/dist/device/device-context.d.ts +1 -2
- package/dist/device/device-link-transform.d.ts +0 -1
- package/dist/device/device-management.d.ts +0 -1
- package/dist/device/device-profile.d.ts +0 -1
- package/dist/device/device-runtime-state.d.ts +0 -1
- package/dist/device/device-state-handle.d.ts +0 -1
- package/dist/device/device-type.d.ts +0 -1
- package/dist/device/device.d.ts +0 -1
- package/dist/device/features.d.ts +0 -1
- package/dist/device/index.d.ts +5 -6
- package/dist/device/path-util.d.ts +0 -1
- package/dist/device/runtime-state-helpers.d.ts +0 -1
- package/dist/device/schema-fields.d.ts +0 -1
- package/dist/device/source-info.d.ts +0 -1
- package/dist/device/system-mirror.d.ts +0 -1
- package/dist/device/zod-to-config-ui.d.ts +0 -1
- package/dist/disposer-chain.d.ts +0 -1
- package/dist/encode-profile.d.ts +0 -1
- package/dist/enums/event-category.d.ts +12 -2
- package/dist/enums/event-source-type.d.ts +0 -1
- package/dist/enums/index.d.ts +0 -1
- package/dist/generated/addon-api.d.ts +1128 -17
- package/dist/generated/cap-status-types.d.ts +0 -1
- package/dist/generated/capability-router-map.d.ts +14 -3
- package/dist/generated/device-local-state.d.ts +0 -1
- package/dist/generated/device-proxy.d.ts +7 -2
- package/dist/generated/method-access-map.d.ts +1 -2
- package/dist/generated/provider-kind-map.d.ts +0 -1
- package/dist/generated/scope-presets.d.ts +0 -1
- package/dist/generated/system-proxy.d.ts +5 -2
- package/dist/health/wiring-health.d.ts +0 -1
- package/dist/helpers/bind-addon-actions.d.ts +0 -1
- package/dist/index.d.ts +10 -10
- package/dist/index.js +28780 -7364
- package/dist/index.mjs +28207 -7478
- package/dist/interfaces/addon-data-plane.d.ts +0 -1
- package/dist/interfaces/addon-routes.d.ts +0 -1
- package/dist/interfaces/addon.d.ts +0 -1
- package/dist/interfaces/advanced-notifier.d.ts +0 -1
- package/dist/interfaces/agent-protocol.d.ts +0 -1
- package/dist/interfaces/agent.d.ts +0 -1
- package/dist/interfaces/alerts.d.ts +0 -1
- package/dist/interfaces/analysis-persistence.d.ts +0 -1
- package/dist/interfaces/analysis.d.ts +0 -1
- package/dist/interfaces/api-responses.d.ts +0 -1
- package/dist/interfaces/api-shared.d.ts +0 -1
- package/dist/interfaces/audio-analyzer.d.ts +0 -1
- package/dist/interfaces/audio-codec.d.ts +0 -1
- package/dist/interfaces/audio-inference-engine.d.ts +0 -1
- package/dist/interfaces/auth.d.ts +0 -1
- package/dist/interfaces/camera-pipeline.d.ts +0 -1
- package/dist/interfaces/capability.d.ts +47 -48
- package/dist/interfaces/config-ui.d.ts +3 -4
- package/dist/interfaces/context.d.ts +0 -1
- package/dist/interfaces/decoder.d.ts +0 -1
- package/dist/interfaces/detection-addon.d.ts +0 -1
- package/dist/interfaces/device-capabilities/camera.d.ts +0 -1
- package/dist/interfaces/device-capabilities/index.d.ts +0 -1
- package/dist/interfaces/device-provider.d.ts +0 -1
- package/dist/interfaces/device.d.ts +0 -1
- package/dist/interfaces/embedding-encoder.d.ts +0 -1
- package/dist/interfaces/engine-slots.d.ts +0 -1
- package/dist/interfaces/event-bus.d.ts +16 -6
- package/dist/interfaces/feature-flags.d.ts +0 -1
- package/dist/interfaces/ffmpeg.d.ts +0 -1
- package/dist/interfaces/frame-handle.d.ts +0 -1
- package/dist/interfaces/inference-capabilities.d.ts +0 -1
- package/dist/interfaces/inference-engine.d.ts +0 -1
- package/dist/interfaces/integration-registry.d.ts +0 -1
- package/dist/interfaces/kernel-abstractions.d.ts +0 -1
- package/dist/interfaces/lifecycle.d.ts +0 -1
- package/dist/interfaces/logging.d.ts +0 -1
- package/dist/interfaces/metrics-provider.d.ts +0 -1
- package/dist/interfaces/network-quality.d.ts +0 -1
- package/dist/interfaces/network.d.ts +0 -1
- package/dist/interfaces/notification.d.ts +0 -1
- package/dist/interfaces/pipeline-executor-capability.d.ts +0 -1
- package/dist/interfaces/pipeline-orchestrator-capability.d.ts +0 -1
- package/dist/interfaces/pipeline-runner-capability.d.ts +4 -1
- package/dist/interfaces/pipeline-runner.d.ts +0 -1
- package/dist/interfaces/pipeline-slot.d.ts +0 -1
- package/dist/interfaces/platform.d.ts +0 -1
- package/dist/interfaces/process.d.ts +0 -1
- package/dist/interfaces/python-env.d.ts +0 -1
- package/dist/interfaces/queryable.d.ts +0 -1
- package/dist/interfaces/raw-tensor-engine.d.ts +0 -1
- package/dist/interfaces/readiness.d.ts +0 -1
- package/dist/interfaces/recording-config-migrate.d.ts +12 -0
- package/dist/interfaces/recording-config.d.ts +119 -2
- package/dist/interfaces/repl.d.ts +0 -1
- package/dist/interfaces/restreamer.d.ts +0 -1
- package/dist/interfaces/router.d.ts +0 -1
- package/dist/interfaces/rtp-egress.d.ts +0 -1
- package/dist/interfaces/scoped-token.d.ts +0 -1
- package/dist/interfaces/server-analysis.d.ts +2 -3
- package/dist/interfaces/server-network.d.ts +0 -1
- package/dist/interfaces/storage-location-declaration.d.ts +0 -1
- package/dist/interfaces/storage-location.d.ts +1 -1
- package/dist/interfaces/storage.d.ts +0 -1
- package/dist/interfaces/stream-broker.d.ts +2 -1
- package/dist/interfaces/streaming.d.ts +0 -1
- package/dist/interfaces/task-handler.d.ts +0 -1
- package/dist/interfaces/timezones.d.ts +0 -1
- package/dist/interfaces/webrtc-provider.d.ts +0 -1
- package/dist/node.d.ts +0 -1
- package/dist/node.js +624 -462
- package/dist/node.mjs +604 -443
- package/dist/readiness/index.d.ts +0 -1
- package/dist/readiness/readiness-registry.d.ts +0 -1
- package/dist/schemas/auth-records.d.ts +0 -1
- package/dist/storage/filesystem-storage-provider.d.ts +0 -1
- package/dist/stream-selection.d.ts +0 -1
- package/dist/types/agent-pipeline-settings.d.ts +0 -1
- package/dist/types/analytics.d.ts +0 -1
- package/dist/types/camera-detection.d.ts +0 -1
- package/dist/types/camera-pipeline.d.ts +0 -1
- package/dist/types/config.d.ts +0 -1
- package/dist/types/detection.d.ts +12 -1
- package/dist/types/device-type.d.ts +0 -1
- package/dist/types/engine-output.d.ts +0 -1
- package/dist/types/entities.d.ts +0 -1
- package/dist/types/events.d.ts +0 -1
- package/dist/types/io.d.ts +0 -1
- package/dist/types/labels.d.ts +0 -1
- package/dist/types/live-state.d.ts +0 -1
- package/dist/types/models.d.ts +8 -1
- package/dist/types/pipeline-schema.d.ts +0 -1
- package/dist/types/pipeline-step.d.ts +0 -1
- package/dist/types/pipeline.d.ts +0 -1
- package/dist/types/tracked.d.ts +0 -1
- package/dist/util/location-match.d.ts +0 -1
- package/dist/utils/canonical-hash.d.ts +0 -1
- package/dist/utils/cosine-similarity.d.ts +0 -1
- package/dist/utils/element-config-store.d.ts +0 -1
- package/dist/utils/err-msg.d.ts +0 -1
- package/dist/utils/export-reconciler.d.ts +0 -1
- package/dist/utils/hf-url.d.ts +0 -1
- package/dist/utils/json-safe.d.ts +0 -1
- package/dist/utils/mask-url.d.ts +0 -1
- package/dist/utils/privacy-grid-raster.d.ts +0 -1
- package/dist/utils/ring-buffer.d.ts +0 -1
- package/dist/utils/run-inference-step.d.ts +0 -1
- package/dist/utils/runtime-mapping.d.ts +0 -1
- package/dist/utils/sleep.d.ts +0 -1
- package/dist/utils/zone-rule-eval.d.ts +0 -1
- package/package.json +3 -2
- package/dist/addon/base-addon.d.ts.map +0 -1
- package/dist/addon/build-addon-route-provider.d.ts.map +0 -1
- package/dist/addon/durable-state.d.ts.map +0 -1
- package/dist/capabilities/accessories.cap.d.ts.map +0 -1
- package/dist/capabilities/addon-pages-source.cap.d.ts.map +0 -1
- package/dist/capabilities/addon-pages.cap.d.ts.map +0 -1
- package/dist/capabilities/addon-routes.cap.d.ts.map +0 -1
- package/dist/capabilities/addon-settings.cap.d.ts.map +0 -1
- package/dist/capabilities/addon-widgets-source.cap.d.ts.map +0 -1
- package/dist/capabilities/addon-widgets.cap.d.ts.map +0 -1
- package/dist/capabilities/addons.cap.d.ts.map +0 -1
- package/dist/capabilities/admin-ui.cap.d.ts.map +0 -1
- package/dist/capabilities/advanced-notifier.cap.d.ts.map +0 -1
- package/dist/capabilities/air-quality-sensor.cap.d.ts.map +0 -1
- package/dist/capabilities/alarm-panel.cap.d.ts.map +0 -1
- package/dist/capabilities/alerts.cap.d.ts.map +0 -1
- package/dist/capabilities/ambient-light-sensor.cap.d.ts.map +0 -1
- package/dist/capabilities/audio-analysis.cap.d.ts.map +0 -1
- package/dist/capabilities/audio-analyzer.cap.d.ts.map +0 -1
- package/dist/capabilities/audio-codec.cap.d.ts.map +0 -1
- package/dist/capabilities/audio-metrics.cap.d.ts.map +0 -1
- package/dist/capabilities/auth-provider.cap.d.ts.map +0 -1
- package/dist/capabilities/automation-control.cap.d.ts.map +0 -1
- package/dist/capabilities/backup.cap.d.ts.map +0 -1
- package/dist/capabilities/battery.cap.d.ts.map +0 -1
- package/dist/capabilities/binary.cap.d.ts.map +0 -1
- package/dist/capabilities/brightness.cap.d.ts.map +0 -1
- package/dist/capabilities/broker.cap.d.ts.map +0 -1
- package/dist/capabilities/button.cap.d.ts.map +0 -1
- package/dist/capabilities/camera-credentials.cap.d.ts.map +0 -1
- package/dist/capabilities/camera-pipeline-config.cap.d.ts.map +0 -1
- package/dist/capabilities/camera-streams.cap.d.ts.map +0 -1
- package/dist/capabilities/capability-definition.d.ts.map +0 -1
- package/dist/capabilities/carbon-monoxide.cap.d.ts.map +0 -1
- package/dist/capabilities/climate-control.cap.d.ts.map +0 -1
- package/dist/capabilities/color.cap.d.ts.map +0 -1
- package/dist/capabilities/connectivity.cap.d.ts.map +0 -1
- package/dist/capabilities/consumables.cap.d.ts.map +0 -1
- package/dist/capabilities/contact.cap.d.ts.map +0 -1
- package/dist/capabilities/control.cap.d.ts.map +0 -1
- package/dist/capabilities/cover.cap.d.ts.map +0 -1
- package/dist/capabilities/custom-actions.d.ts.map +0 -1
- package/dist/capabilities/decoder.cap.d.ts.map +0 -1
- package/dist/capabilities/detection-pipeline.cap.d.ts.map +0 -1
- package/dist/capabilities/device-adoption.cap.d.ts.map +0 -1
- package/dist/capabilities/device-discovery.cap.d.ts.map +0 -1
- package/dist/capabilities/device-export.cap.d.ts.map +0 -1
- package/dist/capabilities/device-manager.cap.d.ts.map +0 -1
- package/dist/capabilities/device-ops.cap.d.ts.map +0 -1
- package/dist/capabilities/device-provider.cap.d.ts.map +0 -1
- package/dist/capabilities/device-state.cap.d.ts.map +0 -1
- package/dist/capabilities/device-status.cap.d.ts.map +0 -1
- package/dist/capabilities/doorbell.cap.d.ts.map +0 -1
- package/dist/capabilities/embedding-encoder.cap.d.ts.map +0 -1
- package/dist/capabilities/enum-sensor.cap.d.ts.map +0 -1
- package/dist/capabilities/event-emitter.cap.d.ts.map +0 -1
- package/dist/capabilities/events.cap.d.ts.map +0 -1
- package/dist/capabilities/fan-control.cap.d.ts.map +0 -1
- package/dist/capabilities/feature-probe.cap.d.ts.map +0 -1
- package/dist/capabilities/flood.cap.d.ts.map +0 -1
- package/dist/capabilities/gas.cap.d.ts.map +0 -1
- package/dist/capabilities/humidifier.cap.d.ts.map +0 -1
- package/dist/capabilities/humidity-sensor.cap.d.ts.map +0 -1
- package/dist/capabilities/image.cap.d.ts.map +0 -1
- package/dist/capabilities/index.d.ts.map +0 -1
- package/dist/capabilities/integrations.cap.d.ts.map +0 -1
- package/dist/capabilities/intercom.cap.d.ts.map +0 -1
- package/dist/capabilities/lawn-mower-control.cap.d.ts.map +0 -1
- package/dist/capabilities/local-network.cap.d.ts.map +0 -1
- package/dist/capabilities/lock-control.cap.d.ts.map +0 -1
- package/dist/capabilities/log-destination.cap.d.ts.map +0 -1
- package/dist/capabilities/mask-shape.d.ts.map +0 -1
- package/dist/capabilities/media-player.cap.d.ts.map +0 -1
- package/dist/capabilities/mesh-network.cap.d.ts.map +0 -1
- package/dist/capabilities/metrics-provider.cap.d.ts.map +0 -1
- package/dist/capabilities/motion-detection.cap.d.ts.map +0 -1
- package/dist/capabilities/motion-trigger.cap.d.ts.map +0 -1
- package/dist/capabilities/motion-zones.cap.d.ts.map +0 -1
- package/dist/capabilities/motion.cap.d.ts.map +0 -1
- package/dist/capabilities/mqtt-broker.cap.d.ts.map +0 -1
- package/dist/capabilities/native-object-detection.cap.d.ts.map +0 -1
- package/dist/capabilities/network-access.cap.d.ts.map +0 -1
- package/dist/capabilities/network-quality.cap.d.ts.map +0 -1
- package/dist/capabilities/nodes.cap.d.ts.map +0 -1
- package/dist/capabilities/notification-output.cap.d.ts.map +0 -1
- package/dist/capabilities/notifier.cap.d.ts.map +0 -1
- package/dist/capabilities/numeric-sensor.cap.d.ts.map +0 -1
- package/dist/capabilities/oauth-integration.cap.d.ts.map +0 -1
- package/dist/capabilities/osd.cap.d.ts.map +0 -1
- package/dist/capabilities/pipeline-analytics.cap.d.ts.map +0 -1
- package/dist/capabilities/pipeline-executor.cap.d.ts.map +0 -1
- package/dist/capabilities/pipeline-orchestrator.cap.d.ts.map +0 -1
- package/dist/capabilities/pipeline-runner.cap.d.ts.map +0 -1
- package/dist/capabilities/platform-probe.cap.d.ts.map +0 -1
- package/dist/capabilities/power-meter.cap.d.ts.map +0 -1
- package/dist/capabilities/presence.cap.d.ts.map +0 -1
- package/dist/capabilities/pressure-sensor.cap.d.ts.map +0 -1
- package/dist/capabilities/privacy-mask.cap.d.ts.map +0 -1
- package/dist/capabilities/ptz-autotrack.cap.d.ts.map +0 -1
- package/dist/capabilities/ptz.cap.d.ts.map +0 -1
- package/dist/capabilities/reboot.cap.d.ts.map +0 -1
- package/dist/capabilities/recording.cap.d.ts.map +0 -1
- package/dist/capabilities/restreamer.cap.d.ts.map +0 -1
- package/dist/capabilities/schemas/detection-shared.d.ts.map +0 -1
- package/dist/capabilities/schemas/orchestrator-metrics.d.ts.map +0 -1
- package/dist/capabilities/schemas/streaming-shared.d.ts.map +0 -1
- package/dist/capabilities/schemas/zone-rule.d.ts.map +0 -1
- package/dist/capabilities/script-runner.cap.d.ts.map +0 -1
- package/dist/capabilities/settings-store.cap.d.ts.map +0 -1
- package/dist/capabilities/smoke.cap.d.ts.map +0 -1
- package/dist/capabilities/smtp-provider.cap.d.ts.map +0 -1
- package/dist/capabilities/snapshot-provider.cap.d.ts.map +0 -1
- package/dist/capabilities/snapshot.cap.d.ts.map +0 -1
- package/dist/capabilities/sso-bridge.cap.d.ts.map +0 -1
- package/dist/capabilities/storage-evictable.cap.d.ts.map +0 -1
- package/dist/capabilities/storage-provider.cap.d.ts.map +0 -1
- package/dist/capabilities/storage.cap.d.ts.map +0 -1
- package/dist/capabilities/stream-broker.cap.d.ts.map +0 -1
- package/dist/capabilities/stream-catalog.cap.d.ts.map +0 -1
- package/dist/capabilities/stream-params-config-schema.d.ts.map +0 -1
- package/dist/capabilities/stream-params.cap.d.ts.map +0 -1
- package/dist/capabilities/streaming-engine.cap.d.ts.map +0 -1
- package/dist/capabilities/switch.cap.d.ts.map +0 -1
- package/dist/capabilities/system.cap.d.ts.map +0 -1
- package/dist/capabilities/tamper.cap.d.ts.map +0 -1
- package/dist/capabilities/temperature-sensor.cap.d.ts.map +0 -1
- package/dist/capabilities/toast.cap.d.ts.map +0 -1
- package/dist/capabilities/turn-provider.cap.d.ts.map +0 -1
- package/dist/capabilities/update.cap.d.ts.map +0 -1
- package/dist/capabilities/user-management.cap.d.ts.map +0 -1
- package/dist/capabilities/user-passkeys.cap.d.ts.map +0 -1
- package/dist/capabilities/vacuum-control.cap.d.ts.map +0 -1
- package/dist/capabilities/valve.cap.d.ts.map +0 -1
- package/dist/capabilities/vibration.cap.d.ts.map +0 -1
- package/dist/capabilities/water-heater.cap.d.ts.map +0 -1
- package/dist/capabilities/weather.cap.d.ts.map +0 -1
- package/dist/capabilities/webrtc-session.cap.d.ts.map +0 -1
- package/dist/capabilities/webrtc.cap.d.ts.map +0 -1
- package/dist/capabilities/zone-analytics.cap.d.ts.map +0 -1
- package/dist/capabilities/zone-rules.cap.d.ts.map +0 -1
- package/dist/capabilities/zones.cap.d.ts.map +0 -1
- package/dist/catalogs/audio-classmap.d.ts.map +0 -1
- package/dist/catalogs/coco-classmap.d.ts.map +0 -1
- package/dist/catalogs/index.d.ts.map +0 -1
- package/dist/constants.d.ts.map +0 -1
- package/dist/deps/binary-downloader.d.ts.map +0 -1
- package/dist/deps/ffmpeg-downloader.d.ts.map +0 -1
- package/dist/deps/index.d.ts.map +0 -1
- package/dist/deps/python-downloader.d.ts.map +0 -1
- package/dist/device/accessory.d.ts.map +0 -1
- package/dist/device/base-device-provider.d.ts.map +0 -1
- package/dist/device/base-device.d.ts.map +0 -1
- package/dist/device/camera-device.d.ts.map +0 -1
- package/dist/device/device-binding.d.ts.map +0 -1
- package/dist/device/device-config.d.ts.map +0 -1
- package/dist/device/device-context.d.ts.map +0 -1
- package/dist/device/device-link-transform.d.ts.map +0 -1
- package/dist/device/device-management.d.ts.map +0 -1
- package/dist/device/device-profile.d.ts.map +0 -1
- package/dist/device/device-runtime-state.d.ts.map +0 -1
- package/dist/device/device-state-handle.d.ts.map +0 -1
- package/dist/device/device-type.d.ts.map +0 -1
- package/dist/device/device.d.ts.map +0 -1
- package/dist/device/features.d.ts.map +0 -1
- package/dist/device/index.d.ts.map +0 -1
- package/dist/device/path-util.d.ts.map +0 -1
- package/dist/device/runtime-state-helpers.d.ts.map +0 -1
- package/dist/device/schema-fields.d.ts.map +0 -1
- package/dist/device/source-info.d.ts.map +0 -1
- package/dist/device/system-mirror.d.ts.map +0 -1
- package/dist/device/zod-to-config-ui.d.ts.map +0 -1
- package/dist/disposer-chain.d.ts.map +0 -1
- package/dist/encode-profile.d.ts.map +0 -1
- package/dist/enums/event-category.d.ts.map +0 -1
- package/dist/enums/event-source-type.d.ts.map +0 -1
- package/dist/enums/index.d.ts.map +0 -1
- package/dist/generated/addon-api.d.ts.map +0 -1
- package/dist/generated/cap-status-types.d.ts.map +0 -1
- package/dist/generated/capability-router-map.d.ts.map +0 -1
- package/dist/generated/device-local-state.d.ts.map +0 -1
- package/dist/generated/device-proxy.d.ts.map +0 -1
- package/dist/generated/method-access-map.d.ts.map +0 -1
- package/dist/generated/provider-kind-map.d.ts.map +0 -1
- package/dist/generated/scope-presets.d.ts.map +0 -1
- package/dist/generated/system-proxy.d.ts.map +0 -1
- package/dist/health/wiring-health.d.ts.map +0 -1
- package/dist/helpers/bind-addon-actions.d.ts.map +0 -1
- package/dist/index-BSA_TBea.js +0 -13311
- package/dist/index-BSA_TBea.js.map +0 -1
- package/dist/index-Bpj3ScIH.mjs +0 -13312
- package/dist/index-Bpj3ScIH.mjs.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/interfaces/addon-data-plane.d.ts.map +0 -1
- package/dist/interfaces/addon-routes.d.ts.map +0 -1
- package/dist/interfaces/addon.d.ts.map +0 -1
- package/dist/interfaces/advanced-notifier.d.ts.map +0 -1
- package/dist/interfaces/agent-protocol.d.ts.map +0 -1
- package/dist/interfaces/agent.d.ts.map +0 -1
- package/dist/interfaces/alerts.d.ts.map +0 -1
- package/dist/interfaces/analysis-persistence.d.ts.map +0 -1
- package/dist/interfaces/analysis.d.ts.map +0 -1
- package/dist/interfaces/api-responses.d.ts.map +0 -1
- package/dist/interfaces/api-shared.d.ts.map +0 -1
- package/dist/interfaces/audio-analyzer.d.ts.map +0 -1
- package/dist/interfaces/audio-codec.d.ts.map +0 -1
- package/dist/interfaces/audio-inference-engine.d.ts.map +0 -1
- package/dist/interfaces/auth.d.ts.map +0 -1
- package/dist/interfaces/camera-pipeline.d.ts.map +0 -1
- package/dist/interfaces/capability.d.ts.map +0 -1
- package/dist/interfaces/config-ui.d.ts.map +0 -1
- package/dist/interfaces/context.d.ts.map +0 -1
- package/dist/interfaces/decoder.d.ts.map +0 -1
- package/dist/interfaces/detection-addon.d.ts.map +0 -1
- package/dist/interfaces/device-capabilities/camera.d.ts.map +0 -1
- package/dist/interfaces/device-capabilities/index.d.ts.map +0 -1
- package/dist/interfaces/device-provider.d.ts.map +0 -1
- package/dist/interfaces/device.d.ts.map +0 -1
- package/dist/interfaces/embedding-encoder.d.ts.map +0 -1
- package/dist/interfaces/engine-slots.d.ts.map +0 -1
- package/dist/interfaces/event-bus.d.ts.map +0 -1
- package/dist/interfaces/feature-flags.d.ts.map +0 -1
- package/dist/interfaces/ffmpeg.d.ts.map +0 -1
- package/dist/interfaces/frame-handle.d.ts.map +0 -1
- package/dist/interfaces/inference-capabilities.d.ts.map +0 -1
- package/dist/interfaces/inference-engine.d.ts.map +0 -1
- package/dist/interfaces/integration-registry.d.ts.map +0 -1
- package/dist/interfaces/kernel-abstractions.d.ts.map +0 -1
- package/dist/interfaces/lifecycle.d.ts.map +0 -1
- package/dist/interfaces/logging.d.ts.map +0 -1
- package/dist/interfaces/metrics-provider.d.ts.map +0 -1
- package/dist/interfaces/network-quality.d.ts.map +0 -1
- package/dist/interfaces/network.d.ts.map +0 -1
- package/dist/interfaces/notification.d.ts.map +0 -1
- package/dist/interfaces/pipeline-executor-capability.d.ts.map +0 -1
- package/dist/interfaces/pipeline-orchestrator-capability.d.ts.map +0 -1
- package/dist/interfaces/pipeline-runner-capability.d.ts.map +0 -1
- package/dist/interfaces/pipeline-runner.d.ts.map +0 -1
- package/dist/interfaces/pipeline-slot.d.ts.map +0 -1
- package/dist/interfaces/platform.d.ts.map +0 -1
- package/dist/interfaces/process.d.ts.map +0 -1
- package/dist/interfaces/python-env.d.ts.map +0 -1
- package/dist/interfaces/queryable.d.ts.map +0 -1
- package/dist/interfaces/raw-tensor-engine.d.ts.map +0 -1
- package/dist/interfaces/readiness.d.ts.map +0 -1
- package/dist/interfaces/recording-config.d.ts.map +0 -1
- package/dist/interfaces/repl.d.ts.map +0 -1
- package/dist/interfaces/restreamer.d.ts.map +0 -1
- package/dist/interfaces/router.d.ts.map +0 -1
- package/dist/interfaces/rtp-egress.d.ts.map +0 -1
- package/dist/interfaces/scoped-token.d.ts.map +0 -1
- package/dist/interfaces/server-analysis.d.ts.map +0 -1
- package/dist/interfaces/server-network.d.ts.map +0 -1
- package/dist/interfaces/storage-location-declaration.d.ts.map +0 -1
- package/dist/interfaces/storage-location.d.ts.map +0 -1
- package/dist/interfaces/storage.d.ts.map +0 -1
- package/dist/interfaces/stream-broker.d.ts.map +0 -1
- package/dist/interfaces/streaming.d.ts.map +0 -1
- package/dist/interfaces/task-handler.d.ts.map +0 -1
- package/dist/interfaces/timezones.d.ts.map +0 -1
- package/dist/interfaces/webrtc-provider.d.ts.map +0 -1
- package/dist/node.d.ts.map +0 -1
- package/dist/node.js.map +0 -1
- package/dist/node.mjs.map +0 -1
- package/dist/readiness/index.d.ts.map +0 -1
- package/dist/readiness/readiness-registry.d.ts.map +0 -1
- package/dist/schemas/auth-records.d.ts.map +0 -1
- package/dist/storage/filesystem-storage-provider.d.ts.map +0 -1
- package/dist/stream-selection.d.ts.map +0 -1
- package/dist/types/agent-pipeline-settings.d.ts.map +0 -1
- package/dist/types/analytics.d.ts.map +0 -1
- package/dist/types/camera-detection.d.ts.map +0 -1
- package/dist/types/camera-pipeline.d.ts.map +0 -1
- package/dist/types/config.d.ts.map +0 -1
- package/dist/types/detection.d.ts.map +0 -1
- package/dist/types/device-type.d.ts.map +0 -1
- package/dist/types/engine-output.d.ts.map +0 -1
- package/dist/types/entities.d.ts.map +0 -1
- package/dist/types/events.d.ts.map +0 -1
- package/dist/types/io.d.ts.map +0 -1
- package/dist/types/labels.d.ts.map +0 -1
- package/dist/types/live-state.d.ts.map +0 -1
- package/dist/types/models.d.ts.map +0 -1
- package/dist/types/pipeline-schema.d.ts.map +0 -1
- package/dist/types/pipeline-step.d.ts.map +0 -1
- package/dist/types/pipeline.d.ts.map +0 -1
- package/dist/types/tracked.d.ts.map +0 -1
- package/dist/util/location-match.d.ts.map +0 -1
- package/dist/utils/canonical-hash.d.ts.map +0 -1
- package/dist/utils/cosine-similarity.d.ts.map +0 -1
- package/dist/utils/element-config-store.d.ts.map +0 -1
- package/dist/utils/err-msg.d.ts.map +0 -1
- package/dist/utils/export-reconciler.d.ts.map +0 -1
- package/dist/utils/hf-url.d.ts.map +0 -1
- package/dist/utils/json-safe.d.ts.map +0 -1
- package/dist/utils/mask-url.d.ts.map +0 -1
- package/dist/utils/privacy-grid-raster.d.ts.map +0 -1
- package/dist/utils/ring-buffer.d.ts.map +0 -1
- package/dist/utils/run-inference-step.d.ts.map +0 -1
- package/dist/utils/runtime-mapping.d.ts.map +0 -1
- package/dist/utils/sleep.d.ts.map +0 -1
- package/dist/utils/zone-rule-eval.d.ts.map +0 -1
package/dist/node.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
"
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
2
3
|
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -6,503 +7,665 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
6
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
9
|
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
|
+
get: ((k) => from[k]).bind(null, key),
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
15
18
|
};
|
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const index = require("./index-BSA_TBea.js");
|
|
32
|
-
require("zod");
|
|
33
|
-
function _interopNamespaceDefault(e) {
|
|
34
|
-
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
35
|
-
if (e) {
|
|
36
|
-
for (const k in e) {
|
|
37
|
-
if (k !== "default") {
|
|
38
|
-
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
39
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
40
|
-
enumerable: true,
|
|
41
|
-
get: () => e[k]
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
n.default = e;
|
|
47
|
-
return Object.freeze(n);
|
|
48
|
-
}
|
|
49
|
-
const fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs);
|
|
50
|
-
const path__namespace = /* @__PURE__ */ _interopNamespaceDefault(path);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
20
|
+
value: mod,
|
|
21
|
+
enumerable: true
|
|
22
|
+
}) : target, mod));
|
|
23
|
+
//#endregion
|
|
24
|
+
const require_index = require("./index.js");
|
|
25
|
+
let node_fs = require("node:fs");
|
|
26
|
+
node_fs = __toESM(node_fs);
|
|
27
|
+
let node_path = require("node:path");
|
|
28
|
+
node_path = __toESM(node_path);
|
|
29
|
+
let node_stream_promises = require("node:stream/promises");
|
|
30
|
+
let node_stream = require("node:stream");
|
|
31
|
+
let node_child_process = require("node:child_process");
|
|
32
|
+
let node_crypto = require("node:crypto");
|
|
33
|
+
//#region src/deps/binary-downloader.ts
|
|
51
34
|
function getPlatformInfo() {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
35
|
+
return {
|
|
36
|
+
platform: process.platform,
|
|
37
|
+
arch: process.arch
|
|
38
|
+
};
|
|
56
39
|
}
|
|
57
40
|
function buildBinaryPath(dataDir, name, platform) {
|
|
58
|
-
|
|
59
|
-
return path.join(dataDir, "deps", `${name}${ext}`);
|
|
41
|
+
return (0, node_path.join)(dataDir, "deps", `${name}${(platform ?? process.platform) === "win32" ? ".exe" : ""}`);
|
|
60
42
|
}
|
|
43
|
+
/** Check if a binary exists in PATH */
|
|
61
44
|
function findInPath(name) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
45
|
+
try {
|
|
46
|
+
(0, node_child_process.execFileSync)(name, ["--version"], {
|
|
47
|
+
stdio: "pipe",
|
|
48
|
+
timeout: 5e3
|
|
49
|
+
});
|
|
50
|
+
return name;
|
|
51
|
+
} catch {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
68
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* Download a binary to the target directory.
|
|
57
|
+
* Handles archives (zip, tar.gz, tar.xz) and raw binaries.
|
|
58
|
+
*/
|
|
69
59
|
async function downloadBinary(opts) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
60
|
+
const { name, url, targetDir, targetName, logger, isArchive, archiveFormat, archiveInnerPath } = opts;
|
|
61
|
+
const targetPath = (0, node_path.join)(targetDir, targetName);
|
|
62
|
+
if ((0, node_fs.existsSync)(targetPath)) {
|
|
63
|
+
logger.debug("Binary already exists", { meta: {
|
|
64
|
+
name,
|
|
65
|
+
targetPath
|
|
66
|
+
} });
|
|
67
|
+
return targetPath;
|
|
68
|
+
}
|
|
69
|
+
(0, node_fs.mkdirSync)(targetDir, { recursive: true });
|
|
70
|
+
logger.info("Downloading binary", { meta: {
|
|
71
|
+
name,
|
|
72
|
+
url
|
|
73
|
+
} });
|
|
74
|
+
const response = await fetch(url, { redirect: "follow" });
|
|
75
|
+
if (!response.ok || !response.body) throw new Error(`Failed to download ${name}: ${response.status} ${response.statusText}`);
|
|
76
|
+
if (isArchive) {
|
|
77
|
+
const ext = archiveFormat ?? "tar.gz";
|
|
78
|
+
const tmpArchive = (0, node_path.join)(targetDir, `${name}-download.${ext}`);
|
|
79
|
+
await (0, node_stream_promises.pipeline)(node_stream.Readable.fromWeb(response.body), (0, node_fs.createWriteStream)(tmpArchive));
|
|
80
|
+
const tmpExtractDir = (0, node_path.join)(targetDir, `${name}-extract`);
|
|
81
|
+
(0, node_fs.mkdirSync)(tmpExtractDir, { recursive: true });
|
|
82
|
+
if (ext === "zip") try {
|
|
83
|
+
(0, node_child_process.execFileSync)("unzip", [
|
|
84
|
+
"-o",
|
|
85
|
+
"-q",
|
|
86
|
+
tmpArchive,
|
|
87
|
+
"-d",
|
|
88
|
+
tmpExtractDir
|
|
89
|
+
], { stdio: "pipe" });
|
|
90
|
+
} catch {
|
|
91
|
+
(0, node_child_process.execFileSync)("tar", [
|
|
92
|
+
"-xf",
|
|
93
|
+
tmpArchive,
|
|
94
|
+
"-C",
|
|
95
|
+
tmpExtractDir
|
|
96
|
+
], { stdio: "pipe" });
|
|
97
|
+
}
|
|
98
|
+
else if (ext === "tar.xz") (0, node_child_process.execFileSync)("tar", [
|
|
99
|
+
"-xJf",
|
|
100
|
+
tmpArchive,
|
|
101
|
+
"-C",
|
|
102
|
+
tmpExtractDir
|
|
103
|
+
], { stdio: "pipe" });
|
|
104
|
+
else (0, node_child_process.execFileSync)("tar", [
|
|
105
|
+
"-xzf",
|
|
106
|
+
tmpArchive,
|
|
107
|
+
"-C",
|
|
108
|
+
tmpExtractDir
|
|
109
|
+
], { stdio: "pipe" });
|
|
110
|
+
if (archiveInnerPath) {
|
|
111
|
+
const { copyFileSync } = await import("node:fs");
|
|
112
|
+
const sourcePath = (0, node_path.join)(tmpExtractDir, archiveInnerPath);
|
|
113
|
+
if (!(0, node_fs.existsSync)(sourcePath)) throw new Error(`Binary not found in archive at ${archiveInnerPath}`);
|
|
114
|
+
copyFileSync(sourcePath, targetPath);
|
|
115
|
+
}
|
|
116
|
+
(0, node_fs.unlinkSync)(tmpArchive);
|
|
117
|
+
const { rmSync } = await import("node:fs");
|
|
118
|
+
rmSync(tmpExtractDir, {
|
|
119
|
+
recursive: true,
|
|
120
|
+
force: true
|
|
121
|
+
});
|
|
122
|
+
} else await (0, node_stream_promises.pipeline)(node_stream.Readable.fromWeb(response.body), (0, node_fs.createWriteStream)(targetPath));
|
|
123
|
+
(0, node_fs.chmodSync)(targetPath, 493);
|
|
124
|
+
logger.info("Binary downloaded", { meta: {
|
|
125
|
+
name,
|
|
126
|
+
targetPath
|
|
127
|
+
} });
|
|
128
|
+
return targetPath;
|
|
118
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* Ensure a binary is available. Checks:
|
|
132
|
+
* 1. Target path (already downloaded)
|
|
133
|
+
* 2. System PATH
|
|
134
|
+
* 3. Download from URL
|
|
135
|
+
*/
|
|
119
136
|
async function ensureBinary(opts) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
137
|
+
const ext = process.platform === "win32" ? ".exe" : "";
|
|
138
|
+
const targetName = `${opts.name}${ext}`;
|
|
139
|
+
const targetPath = (0, node_path.join)(opts.targetDir, targetName);
|
|
140
|
+
if ((0, node_fs.existsSync)(targetPath)) {
|
|
141
|
+
opts.logger.debug("Binary found at target path", { meta: {
|
|
142
|
+
name: opts.name,
|
|
143
|
+
targetPath
|
|
144
|
+
} });
|
|
145
|
+
return targetPath;
|
|
146
|
+
}
|
|
147
|
+
const inPath = findInPath(opts.name);
|
|
148
|
+
if (inPath) {
|
|
149
|
+
opts.logger.info("Binary found in system PATH", { meta: { name: opts.name } });
|
|
150
|
+
return inPath;
|
|
151
|
+
}
|
|
152
|
+
return downloadBinary({
|
|
153
|
+
name: opts.name,
|
|
154
|
+
url: opts.downloadUrl,
|
|
155
|
+
targetDir: opts.targetDir,
|
|
156
|
+
targetName,
|
|
157
|
+
logger: opts.logger,
|
|
158
|
+
isArchive: opts.isArchive,
|
|
159
|
+
archiveFormat: opts.archiveFormat,
|
|
160
|
+
archiveInnerPath: opts.archiveInnerPath
|
|
161
|
+
});
|
|
142
162
|
}
|
|
143
|
-
|
|
163
|
+
//#endregion
|
|
164
|
+
//#region src/deps/ffmpeg-downloader.ts
|
|
165
|
+
/**
|
|
166
|
+
* Download ffmpeg static build for the current platform.
|
|
167
|
+
*
|
|
168
|
+
* Sources:
|
|
169
|
+
* - Linux: https://johnvansickle.com/ffmpeg/ (static builds)
|
|
170
|
+
* - macOS: https://evermeet.cx/ffmpeg/ or homebrew
|
|
171
|
+
*
|
|
172
|
+
* Using BtbN's GitHub releases as they cover both platforms:
|
|
173
|
+
* https://github.com/BtbN/FFmpeg-Builds/releases
|
|
174
|
+
*/
|
|
175
|
+
var FFMPEG_VERSION = "7.1";
|
|
144
176
|
function getFfmpegDownloadUrl(platform, arch) {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
177
|
+
switch (platform) {
|
|
178
|
+
case "linux": {
|
|
179
|
+
const a = {
|
|
180
|
+
x64: "amd64",
|
|
181
|
+
arm64: "arm64"
|
|
182
|
+
}[arch];
|
|
183
|
+
if (!a) throw new Error(`Unsupported Linux architecture: ${arch}`);
|
|
184
|
+
return `https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-${a}-static.tar.xz`;
|
|
185
|
+
}
|
|
186
|
+
case "darwin":
|
|
187
|
+
if (!{
|
|
188
|
+
arm64: "arm64",
|
|
189
|
+
x64: "amd64"
|
|
190
|
+
}[arch]) throw new Error(`Unsupported macOS architecture: ${arch}`);
|
|
191
|
+
return `https://www.osxexperts.net/ffmpeg${FFMPEG_VERSION.replace(".", "")}arm.zip`;
|
|
192
|
+
default: throw new Error(`Unsupported platform: ${platform}`);
|
|
193
|
+
}
|
|
161
194
|
}
|
|
162
195
|
function getFfmpegArchiveInfo(platform) {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
default:
|
|
177
|
-
throw new Error(`Unsupported platform: ${platform}`);
|
|
178
|
-
}
|
|
196
|
+
switch (platform) {
|
|
197
|
+
case "linux": return {
|
|
198
|
+
isArchive: true,
|
|
199
|
+
archiveFormat: "tar.xz",
|
|
200
|
+
archiveInnerPath: `ffmpeg-${FFMPEG_VERSION}-amd64-static/ffmpeg`
|
|
201
|
+
};
|
|
202
|
+
case "darwin": return {
|
|
203
|
+
isArchive: true,
|
|
204
|
+
archiveFormat: "zip",
|
|
205
|
+
archiveInnerPath: "ffmpeg"
|
|
206
|
+
};
|
|
207
|
+
default: throw new Error(`Unsupported platform: ${platform}`);
|
|
208
|
+
}
|
|
179
209
|
}
|
|
210
|
+
/**
|
|
211
|
+
* Ensure ffmpeg binary is available.
|
|
212
|
+
* Checks: deps dir → system PATH → download.
|
|
213
|
+
*/
|
|
180
214
|
async function ensureFfmpeg(dataDir, logger) {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
215
|
+
const depsDir = (0, node_path.join)(dataDir, "deps");
|
|
216
|
+
const platform = process.platform;
|
|
217
|
+
const arch = process.arch;
|
|
218
|
+
const archiveInfo = getFfmpegArchiveInfo(platform);
|
|
219
|
+
return ensureBinary({
|
|
220
|
+
name: "ffmpeg",
|
|
221
|
+
targetDir: depsDir,
|
|
222
|
+
downloadUrl: getFfmpegDownloadUrl(platform, arch),
|
|
223
|
+
logger,
|
|
224
|
+
...archiveInfo
|
|
225
|
+
});
|
|
192
226
|
}
|
|
193
|
-
|
|
194
|
-
|
|
227
|
+
//#endregion
|
|
228
|
+
//#region src/deps/python-downloader.ts
|
|
229
|
+
/**
|
|
230
|
+
* Download portable Python (headless) from bjia56/portable-python.
|
|
231
|
+
*
|
|
232
|
+
* Source: https://github.com/bjia56/portable-python
|
|
233
|
+
*
|
|
234
|
+
* Advantages over python-build-standalone:
|
|
235
|
+
* - macOS universal2 binary (arm64+x86_64 in one)
|
|
236
|
+
* - Lighter (~24-28MB headless zip)
|
|
237
|
+
* - glibc 2.17 minimum (better compat)
|
|
238
|
+
* - Headless variant excludes tkinter/UI (ideal for ML inference)
|
|
239
|
+
*
|
|
240
|
+
* The zip's top-level dir is platform-specific (e.g.
|
|
241
|
+
* `python-headless-3.12.12-darwin-universal2/`); after extraction
|
|
242
|
+
* we rename it to a stable `python/` so consumers can rely on
|
|
243
|
+
* `<dataDir>/deps/python/bin/python3`.
|
|
244
|
+
*/
|
|
245
|
+
var PYTHON_VERSION = "3.12.12";
|
|
246
|
+
var PP_BASE = `https://github.com/bjia56/portable-python/releases/download/cpython-v${PYTHON_VERSION}-build.0`;
|
|
195
247
|
function getPythonDownloadUrl(platform, arch) {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}
|
|
248
|
+
switch (platform) {
|
|
249
|
+
case "linux": {
|
|
250
|
+
const a = {
|
|
251
|
+
x64: "x86_64",
|
|
252
|
+
arm64: "aarch64"
|
|
253
|
+
}[arch];
|
|
254
|
+
if (!a) throw new Error(`Unsupported Linux architecture for Python: ${arch}`);
|
|
255
|
+
return `${PP_BASE}/python-headless-${PYTHON_VERSION}-linux-${a}.zip`;
|
|
256
|
+
}
|
|
257
|
+
case "darwin": return `${PP_BASE}/python-headless-${PYTHON_VERSION}-darwin-universal2.zip`;
|
|
258
|
+
default: throw new Error(`Unsupported platform for portable Python: ${platform}`);
|
|
259
|
+
}
|
|
209
260
|
}
|
|
261
|
+
/**
|
|
262
|
+
* Ensure the embedded portable Python is available.
|
|
263
|
+
*
|
|
264
|
+
* ALWAYS returns the path to the embedded interpreter under
|
|
265
|
+
* `<dataDir>/deps/python/bin/python3` — downloads it on first call
|
|
266
|
+
* and reuses it thereafter. The system PATH is intentionally NOT
|
|
267
|
+
* consulted: addons rely on `installPythonRequirements()` to manage
|
|
268
|
+
* deps inside the embedded site-packages, and a system interpreter
|
|
269
|
+
* (different version, missing modules) silently breaks that contract.
|
|
270
|
+
*
|
|
271
|
+
* Returns null only if the download/extract step fails.
|
|
272
|
+
*/
|
|
210
273
|
async function ensurePython(dataDir, logger) {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
return pythonBin;
|
|
274
|
+
const pythonDir = (0, node_path.join)(dataDir, "deps", "python");
|
|
275
|
+
const pythonBin = (0, node_path.join)(pythonDir, "bin", "python3");
|
|
276
|
+
if ((0, node_fs.existsSync)(pythonBin)) {
|
|
277
|
+
logger.debug("Portable Python found", { meta: { pythonBin } });
|
|
278
|
+
return pythonBin;
|
|
279
|
+
}
|
|
280
|
+
logger.info("Downloading portable Python (headless)", { meta: { version: PYTHON_VERSION } });
|
|
281
|
+
const depsDir = (0, node_path.join)(dataDir, "deps");
|
|
282
|
+
(0, node_fs.mkdirSync)(depsDir, { recursive: true });
|
|
283
|
+
const url = getPythonDownloadUrl(process.platform, process.arch);
|
|
284
|
+
const tmpArchive = (0, node_path.join)(depsDir, "python-download.zip");
|
|
285
|
+
logger.info("Python download source", { meta: { url } });
|
|
286
|
+
const response = await fetch(url, { redirect: "follow" });
|
|
287
|
+
if (!response.ok || !response.body) {
|
|
288
|
+
logger.warn("Failed to download Python — ML detection will not be available", { meta: { status: response.status } });
|
|
289
|
+
return null;
|
|
290
|
+
}
|
|
291
|
+
await (0, node_stream_promises.pipeline)(node_stream.Readable.fromWeb(response.body), (0, node_fs.createWriteStream)(tmpArchive));
|
|
292
|
+
try {
|
|
293
|
+
(0, node_child_process.execFileSync)("unzip", [
|
|
294
|
+
"-o",
|
|
295
|
+
"-q",
|
|
296
|
+
tmpArchive,
|
|
297
|
+
"-d",
|
|
298
|
+
depsDir
|
|
299
|
+
], { stdio: "pipe" });
|
|
300
|
+
} catch {
|
|
301
|
+
(0, node_child_process.execFileSync)("python3", [
|
|
302
|
+
"-m",
|
|
303
|
+
"zipfile",
|
|
304
|
+
"-e",
|
|
305
|
+
tmpArchive,
|
|
306
|
+
depsDir
|
|
307
|
+
], { stdio: "pipe" });
|
|
308
|
+
}
|
|
309
|
+
const { unlinkSync } = await import("node:fs");
|
|
310
|
+
unlinkSync(tmpArchive);
|
|
311
|
+
if (!(0, node_fs.existsSync)(pythonBin)) {
|
|
312
|
+
const candidates = (0, node_fs.readdirSync)(depsDir).filter((name) => name.startsWith("python-") && (0, node_fs.existsSync)((0, node_path.join)(depsDir, name, "bin", "python3")));
|
|
313
|
+
if (candidates.length === 0) {
|
|
314
|
+
logger.warn("Python extraction succeeded but no python3 binary found in any subdir", { meta: { depsDir } });
|
|
315
|
+
return null;
|
|
316
|
+
}
|
|
317
|
+
const extractedRoot = (0, node_path.join)(depsDir, candidates[0]);
|
|
318
|
+
if ((0, node_fs.existsSync)(pythonDir)) (0, node_fs.rmSync)(pythonDir, {
|
|
319
|
+
recursive: true,
|
|
320
|
+
force: true
|
|
321
|
+
});
|
|
322
|
+
(0, node_fs.renameSync)(extractedRoot, pythonDir);
|
|
323
|
+
}
|
|
324
|
+
if (!(0, node_fs.existsSync)(pythonBin)) {
|
|
325
|
+
logger.warn("Python extraction succeeded but binary not found at expected path", { meta: { pythonBin } });
|
|
326
|
+
return null;
|
|
327
|
+
}
|
|
328
|
+
(0, node_fs.chmodSync)(pythonBin, 493);
|
|
329
|
+
if (process.platform === "darwin") {
|
|
330
|
+
const realBin = (0, node_path.join)(pythonDir, "bin", "python3.real");
|
|
331
|
+
if (!(0, node_fs.existsSync)(realBin)) {
|
|
332
|
+
(0, node_fs.renameSync)(pythonBin, realBin);
|
|
333
|
+
const archFlag = process.arch === "arm64" ? "-arm64" : "-x86_64";
|
|
334
|
+
(0, node_fs.writeFileSync)(pythonBin, `#!/bin/sh\nexec /usr/bin/arch ${archFlag} "${realBin}" "$@"\n`);
|
|
335
|
+
(0, node_fs.chmodSync)(pythonBin, 493);
|
|
336
|
+
const pyAlt = (0, node_path.join)(pythonDir, "bin", "python");
|
|
337
|
+
if ((0, node_fs.existsSync)(pyAlt)) {
|
|
338
|
+
try {
|
|
339
|
+
(0, node_fs.rmSync)(pyAlt, { force: true });
|
|
340
|
+
} catch {}
|
|
341
|
+
(0, node_fs.writeFileSync)(pyAlt, `#!/bin/sh\nexec /usr/bin/arch ${archFlag} "${realBin}" "$@"\n`);
|
|
342
|
+
(0, node_fs.chmodSync)(pyAlt, 493);
|
|
343
|
+
}
|
|
344
|
+
logger.info("Locked python3 to host arch via shell stub", { meta: {
|
|
345
|
+
archFlag,
|
|
346
|
+
realBin
|
|
347
|
+
} });
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
logger.info("Portable Python installed", { meta: {
|
|
351
|
+
version: PYTHON_VERSION,
|
|
352
|
+
pythonBin
|
|
353
|
+
} });
|
|
354
|
+
return pythonBin;
|
|
293
355
|
}
|
|
356
|
+
/**
|
|
357
|
+
* Install Python packages into the portable Python environment.
|
|
358
|
+
*/
|
|
294
359
|
async function installPythonPackages(pythonPath, packages, logger) {
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
360
|
+
if (packages.length === 0) return;
|
|
361
|
+
logger.info("Installing Python packages", { meta: { packages } });
|
|
362
|
+
try {
|
|
363
|
+
(0, node_child_process.execFileSync)(pythonPath, [
|
|
364
|
+
"-m",
|
|
365
|
+
"pip",
|
|
366
|
+
"install",
|
|
367
|
+
"--quiet",
|
|
368
|
+
...packages
|
|
369
|
+
], {
|
|
370
|
+
stdio: "pipe",
|
|
371
|
+
timeout: 3e5
|
|
372
|
+
});
|
|
373
|
+
logger.info("Python packages installed successfully");
|
|
374
|
+
} catch (err) {
|
|
375
|
+
logger.error("Failed to install Python packages", { meta: { error: require_index.errMsg$1(err) } });
|
|
376
|
+
throw err;
|
|
377
|
+
}
|
|
308
378
|
}
|
|
379
|
+
/**
|
|
380
|
+
* Install a pip requirements file into the embedded Python.
|
|
381
|
+
*
|
|
382
|
+
* Idempotent: keyed on (requirements file basename + sha256 of its
|
|
383
|
+
* contents). The marker is written under
|
|
384
|
+
* `<python-install-dir>/.requirements-installed/` so it lives and
|
|
385
|
+
* dies with the python install — re-downloading python wipes both
|
|
386
|
+
* the site-packages and the markers, forcing a fresh re-install.
|
|
387
|
+
*
|
|
388
|
+
* The marker is updated only after `pip install` succeeds. A failed
|
|
389
|
+
* install never writes a marker, so the next call retries.
|
|
390
|
+
*/
|
|
309
391
|
async function installPythonRequirements(pythonPath, requirementsFile, logger) {
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
392
|
+
if (!(0, node_fs.existsSync)(requirementsFile)) throw new Error(`Requirements file not found: ${requirementsFile}`);
|
|
393
|
+
const contents = (0, node_fs.readFileSync)(requirementsFile);
|
|
394
|
+
const hash = (0, node_crypto.createHash)("sha256").update(contents).digest("hex").slice(0, 16);
|
|
395
|
+
const fileBase = (0, node_path.basename)(requirementsFile).replace(/\.txt$/i, "");
|
|
396
|
+
const markerDir = (0, node_path.join)((0, node_path.join)(pythonPath, "..", ".."), ".requirements-installed");
|
|
397
|
+
const markerPath = (0, node_path.join)(markerDir, `${fileBase}-${hash}.marker`);
|
|
398
|
+
if ((0, node_fs.existsSync)(markerPath)) {
|
|
399
|
+
logger.debug("Python requirements already installed", { meta: {
|
|
400
|
+
requirementsFile,
|
|
401
|
+
hash
|
|
402
|
+
} });
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
logger.info("Installing Python requirements", { meta: {
|
|
406
|
+
requirementsFile,
|
|
407
|
+
hash
|
|
408
|
+
} });
|
|
409
|
+
try {
|
|
410
|
+
(0, node_child_process.execFileSync)(pythonPath, [
|
|
411
|
+
"-m",
|
|
412
|
+
"pip",
|
|
413
|
+
"install",
|
|
414
|
+
"--quiet",
|
|
415
|
+
"--disable-pip-version-check",
|
|
416
|
+
"-r",
|
|
417
|
+
requirementsFile
|
|
418
|
+
], {
|
|
419
|
+
stdio: "pipe",
|
|
420
|
+
timeout: 6e5
|
|
421
|
+
});
|
|
422
|
+
} catch (err) {
|
|
423
|
+
logger.error("Failed to install Python requirements", { meta: {
|
|
424
|
+
requirementsFile,
|
|
425
|
+
error: require_index.errMsg$1(err)
|
|
426
|
+
} });
|
|
427
|
+
throw err;
|
|
428
|
+
}
|
|
429
|
+
(0, node_fs.mkdirSync)(markerDir, { recursive: true });
|
|
430
|
+
(0, node_fs.writeFileSync)(markerPath, `${requirementsFile}\n${(/* @__PURE__ */ new Date()).toISOString()}\n`);
|
|
431
|
+
logger.info("Python requirements installed", { meta: {
|
|
432
|
+
requirementsFile,
|
|
433
|
+
hash
|
|
434
|
+
} });
|
|
345
435
|
}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
436
|
+
//#endregion
|
|
437
|
+
//#region src/storage/filesystem-storage-provider.ts
|
|
438
|
+
var STORAGE_LOCATION_TYPES = [
|
|
439
|
+
"data",
|
|
440
|
+
"media",
|
|
441
|
+
"recordings",
|
|
442
|
+
"recordings-high",
|
|
443
|
+
"recordings-low",
|
|
444
|
+
"recordings-clips",
|
|
445
|
+
"event-images",
|
|
446
|
+
"models",
|
|
447
|
+
"addons-data",
|
|
448
|
+
"cache",
|
|
449
|
+
"logs",
|
|
450
|
+
"backups"
|
|
359
451
|
];
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
452
|
+
var DEFAULT_LOCATION_SUBDIRS = {
|
|
453
|
+
data: "db",
|
|
454
|
+
media: "media",
|
|
455
|
+
recordings: "recordings",
|
|
456
|
+
"recordings-high": "recordings-high",
|
|
457
|
+
"recordings-low": "recordings-low",
|
|
458
|
+
"recordings-clips": "recordings-clips",
|
|
459
|
+
"event-images": "event-images",
|
|
460
|
+
models: "models",
|
|
461
|
+
"addons-data": "addons-data",
|
|
462
|
+
cache: "/tmp/camstack-cache",
|
|
463
|
+
logs: "logs",
|
|
464
|
+
backups: "backups"
|
|
373
465
|
};
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
+
/**
|
|
467
|
+
* Filesystem storage provider — serves all location types from a local directory tree.
|
|
468
|
+
*
|
|
469
|
+
* Default layout:
|
|
470
|
+
* {rootPath}/recordings-high/
|
|
471
|
+
* {rootPath}/recordings-low/
|
|
472
|
+
* {rootPath}/recordings-clips/
|
|
473
|
+
* {rootPath}/event-images/
|
|
474
|
+
* {rootPath}/models/
|
|
475
|
+
* {rootPath}/addons-data/
|
|
476
|
+
* {rootPath}/logs/
|
|
477
|
+
* /tmp/camstack-cache/ (cache is always local)
|
|
478
|
+
*
|
|
479
|
+
* Individual location paths can be overridden.
|
|
480
|
+
*/
|
|
481
|
+
var FilesystemStorageProvider = class {
|
|
482
|
+
id = "local";
|
|
483
|
+
name = "Local Filesystem";
|
|
484
|
+
supportedLocations = [...STORAGE_LOCATION_TYPES];
|
|
485
|
+
rootPath;
|
|
486
|
+
locationPaths;
|
|
487
|
+
constructor(rootPath, overrides) {
|
|
488
|
+
this.rootPath = node_path.resolve(rootPath);
|
|
489
|
+
this.locationPaths = /* @__PURE__ */ new Map();
|
|
490
|
+
for (const loc of STORAGE_LOCATION_TYPES) {
|
|
491
|
+
const override = overrides?.[loc];
|
|
492
|
+
if (override) this.locationPaths.set(loc, node_path.resolve(override));
|
|
493
|
+
else {
|
|
494
|
+
const subdir = DEFAULT_LOCATION_SUBDIRS[loc] ?? loc;
|
|
495
|
+
this.locationPaths.set(loc, node_path.isAbsolute(subdir) ? subdir : node_path.join(this.rootPath, subdir));
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
async resolve({ location, relativePath }) {
|
|
500
|
+
const base = this.locationPaths.get(location) ?? node_path.join(this.rootPath, location);
|
|
501
|
+
return node_path.join(base, relativePath);
|
|
502
|
+
}
|
|
503
|
+
async write({ location, relativePath, data }) {
|
|
504
|
+
const filePath = await this.resolve({
|
|
505
|
+
location,
|
|
506
|
+
relativePath
|
|
507
|
+
});
|
|
508
|
+
await node_fs.promises.mkdir(node_path.dirname(filePath), { recursive: true });
|
|
509
|
+
if (Buffer.isBuffer(data)) await node_fs.promises.writeFile(filePath, data);
|
|
510
|
+
else {
|
|
511
|
+
const writeStream = node_fs.createWriteStream(filePath);
|
|
512
|
+
await new Promise((resolve, reject) => {
|
|
513
|
+
data.pipe(writeStream);
|
|
514
|
+
writeStream.on("finish", resolve);
|
|
515
|
+
writeStream.on("error", reject);
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
async read({ location, relativePath }) {
|
|
520
|
+
return node_fs.promises.readFile(await this.resolve({
|
|
521
|
+
location,
|
|
522
|
+
relativePath
|
|
523
|
+
}));
|
|
524
|
+
}
|
|
525
|
+
async exists({ location, relativePath }) {
|
|
526
|
+
try {
|
|
527
|
+
await node_fs.promises.access(await this.resolve({
|
|
528
|
+
location,
|
|
529
|
+
relativePath
|
|
530
|
+
}));
|
|
531
|
+
return true;
|
|
532
|
+
} catch {
|
|
533
|
+
return false;
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
async list({ location, prefix }) {
|
|
537
|
+
const base = this.locationPaths.get(location);
|
|
538
|
+
if (!base) return [];
|
|
539
|
+
const dir = prefix ? node_path.join(base, prefix) : base;
|
|
540
|
+
try {
|
|
541
|
+
return (await node_fs.promises.readdir(dir, { withFileTypes: true })).map((e) => prefix ? `${prefix}/${e.name}` : e.name);
|
|
542
|
+
} catch {
|
|
543
|
+
return [];
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
async delete({ location, relativePath }) {
|
|
547
|
+
const filePath = await this.resolve({
|
|
548
|
+
location,
|
|
549
|
+
relativePath
|
|
550
|
+
});
|
|
551
|
+
await node_fs.promises.rm(filePath, { force: true });
|
|
552
|
+
}
|
|
553
|
+
async getAvailableSpace({ location }) {
|
|
554
|
+
const base = this.locationPaths.get(location);
|
|
555
|
+
if (!base) return null;
|
|
556
|
+
try {
|
|
557
|
+
let target = base;
|
|
558
|
+
while (!node_fs.existsSync(target)) {
|
|
559
|
+
const parent = node_path.dirname(target);
|
|
560
|
+
if (!parent || parent === target) return null;
|
|
561
|
+
target = parent;
|
|
562
|
+
}
|
|
563
|
+
const stats = await node_fs.promises.statfs(target);
|
|
564
|
+
return stats.bavail * stats.bsize;
|
|
565
|
+
} catch {
|
|
566
|
+
return null;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
/** Get the resolved path for a location type (addon-declared ids fall back
|
|
570
|
+
* to `<rootPath>/<id>`). */
|
|
571
|
+
getLocationPath(location) {
|
|
572
|
+
return this.locationPaths.get(location) ?? node_path.join(this.rootPath, location);
|
|
573
|
+
}
|
|
574
|
+
/** Get the root path */
|
|
575
|
+
getRootPath() {
|
|
576
|
+
return this.rootPath;
|
|
577
|
+
}
|
|
578
|
+
};
|
|
579
|
+
//#endregion
|
|
580
|
+
//#region src/utils/canonical-hash.ts
|
|
581
|
+
/**
|
|
582
|
+
* Deterministic SHA-256 hash of an arbitrary serialisable value. The
|
|
583
|
+
* canonical form sorts object keys alphabetically at every depth so two
|
|
584
|
+
* structurally-equal inputs with different key insertion orders produce
|
|
585
|
+
* the same hash. Returns a 64-char lowercase hex digest.
|
|
586
|
+
*
|
|
587
|
+
* Used by export adapters (Alexa, HAP) to short-circuit re-discovery /
|
|
588
|
+
* accessory-rebuild work when the upstream shape is byte-identical to
|
|
589
|
+
* the last applied state — preventing user-visible "re-discovery"
|
|
590
|
+
* notifications on every addon-runner respawn. Each respawn re-fires
|
|
591
|
+
* `DeviceBindingsChanged` for every cap registration, which without
|
|
592
|
+
* this guard would propagate redundant pushes.
|
|
593
|
+
*
|
|
594
|
+
* Note: this is a SYMPTOMATIC fix layered on top of the binding-change
|
|
595
|
+
* subscription. The proper fix is a single "device ready" lifecycle
|
|
596
|
+
* barrier so exports react only when the full cap set has landed —
|
|
597
|
+
* tracked separately for post-HA-integration work.
|
|
598
|
+
*/
|
|
466
599
|
function canonicalHash(value) {
|
|
467
|
-
|
|
468
|
-
|
|
600
|
+
const canonical = JSON.stringify(value, replaceWithSortedKeys);
|
|
601
|
+
return (0, node_crypto.createHash)("sha256").update(canonical ?? "").digest("hex");
|
|
469
602
|
}
|
|
470
603
|
function replaceWithSortedKeys(_key, value) {
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
604
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
605
|
+
const obj = value;
|
|
606
|
+
const out = {};
|
|
607
|
+
for (const k of Object.keys(obj).toSorted()) out[k] = obj[k];
|
|
608
|
+
return out;
|
|
609
|
+
}
|
|
610
|
+
return value;
|
|
478
611
|
}
|
|
612
|
+
//#endregion
|
|
613
|
+
//#region src/utils/export-reconciler.ts
|
|
614
|
+
/**
|
|
615
|
+
* Compute the stable 64-char lowercase-hex fingerprint of a device's
|
|
616
|
+
* export-relevant shape. Two structurally-equal shapes (any feature order,
|
|
617
|
+
* any duplicates, any deviceId) hash identically.
|
|
618
|
+
*/
|
|
479
619
|
function canonicalDeviceFingerprint(shape) {
|
|
480
|
-
|
|
481
|
-
|
|
620
|
+
const features = [...new Set(shape.features)].toSorted();
|
|
621
|
+
return canonicalHash({
|
|
622
|
+
deviceType: shape.deviceType,
|
|
623
|
+
features
|
|
624
|
+
});
|
|
482
625
|
}
|
|
626
|
+
/**
|
|
627
|
+
* Pure 3-way diff of desired export state against the persisted
|
|
628
|
+
* last-advertised state, keyed by `deviceId`.
|
|
629
|
+
*
|
|
630
|
+
* - `desired` — one entry per device to advertise this cycle, each carrying
|
|
631
|
+
* the freshly-computed `fingerprint`.
|
|
632
|
+
* - `lastAdvertised` — the exporter's persisted per-target sync state.
|
|
633
|
+
*
|
|
634
|
+
* Neither input is mutated.
|
|
635
|
+
*/
|
|
483
636
|
function diffExportTargets(desired, lastAdvertised) {
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
return { toAdd, toUpdate, toRemove };
|
|
637
|
+
const toAdd = [];
|
|
638
|
+
const toUpdate = [];
|
|
639
|
+
const desiredIds = /* @__PURE__ */ new Set();
|
|
640
|
+
for (const entry of desired) {
|
|
641
|
+
desiredIds.add(entry.deviceId);
|
|
642
|
+
const previous = lastAdvertised.get(entry.deviceId);
|
|
643
|
+
if (previous === void 0) toAdd.push(entry);
|
|
644
|
+
else if (previous.fingerprint !== entry.fingerprint) toUpdate.push(entry);
|
|
645
|
+
}
|
|
646
|
+
const toRemove = [];
|
|
647
|
+
for (const deviceId of lastAdvertised.keys()) if (!desiredIds.has(deviceId)) toRemove.push(deviceId);
|
|
648
|
+
return {
|
|
649
|
+
toAdd,
|
|
650
|
+
toUpdate,
|
|
651
|
+
toRemove
|
|
652
|
+
};
|
|
501
653
|
}
|
|
654
|
+
/**
|
|
655
|
+
* Resolve the fingerprint an exporter should feed into `diffExportTargets`
|
|
656
|
+
* for one device this cycle.
|
|
657
|
+
*
|
|
658
|
+
* When a device is NOT yet probe-ready, carry forward its last-advertised
|
|
659
|
+
* (persisted) fingerprint so it nets to NO CHANGE in `diffExportTargets`
|
|
660
|
+
* (neither update nor remove) — never advertise a partial mid-probe shape. A
|
|
661
|
+
* brand-new un-probed device with no persisted entry falls back to `fresh` so
|
|
662
|
+
* it can advertise once.
|
|
663
|
+
*/
|
|
502
664
|
function resolveExportFingerprint(input) {
|
|
503
|
-
|
|
504
|
-
|
|
665
|
+
if (input.ready) return input.fresh;
|
|
666
|
+
return input.persisted ?? input.fresh;
|
|
505
667
|
}
|
|
668
|
+
//#endregion
|
|
506
669
|
exports.FilesystemStorageProvider = FilesystemStorageProvider;
|
|
507
670
|
exports.PYTHON_VERSION = PYTHON_VERSION;
|
|
508
671
|
exports.buildBinaryPath = buildBinaryPath;
|
|
@@ -520,4 +683,3 @@ exports.getPythonDownloadUrl = getPythonDownloadUrl;
|
|
|
520
683
|
exports.installPythonPackages = installPythonPackages;
|
|
521
684
|
exports.installPythonRequirements = installPythonRequirements;
|
|
522
685
|
exports.resolveExportFingerprint = resolveExportFingerprint;
|
|
523
|
-
//# sourceMappingURL=node.js.map
|