@camstack/types 0.1.14 → 0.1.16
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 +262 -0
- package/dist/addon/base-addon.d.ts.map +1 -0
- package/dist/auth-records-BDg37fy9.mjs +8297 -0
- package/dist/auth-records-BDg37fy9.mjs.map +1 -0
- package/dist/auth-records-D5ZNaUos.js +8296 -0
- package/dist/auth-records-D5ZNaUos.js.map +1 -0
- package/dist/capabilities/accessories.cap.d.ts +42 -0
- package/dist/capabilities/accessories.cap.d.ts.map +1 -0
- package/dist/capabilities/addon-pages-source.cap.d.ts +41 -0
- package/dist/capabilities/addon-pages-source.cap.d.ts.map +1 -0
- package/dist/capabilities/addon-pages.cap.d.ts +36 -0
- package/dist/capabilities/addon-pages.cap.d.ts.map +1 -0
- package/dist/capabilities/addon-routes.cap.d.ts +22 -0
- package/dist/capabilities/addon-routes.cap.d.ts.map +1 -0
- package/dist/capabilities/addon-settings.cap.d.ts +170 -0
- package/dist/capabilities/addon-settings.cap.d.ts.map +1 -0
- package/dist/capabilities/addon-widgets-source.cap.d.ts +103 -0
- package/dist/capabilities/addon-widgets-source.cap.d.ts.map +1 -0
- package/dist/capabilities/addon-widgets.cap.d.ts +98 -0
- package/dist/capabilities/addon-widgets.cap.d.ts.map +1 -0
- package/dist/capabilities/addons.cap.d.ts +356 -0
- package/dist/capabilities/addons.cap.d.ts.map +1 -0
- package/dist/capabilities/admin-ui.cap.d.ts +14 -0
- package/dist/capabilities/admin-ui.cap.d.ts.map +1 -0
- package/dist/capabilities/advanced-notifier.cap.d.ts +60 -0
- package/dist/capabilities/advanced-notifier.cap.d.ts.map +1 -0
- package/dist/capabilities/alerts.cap.d.ts +164 -0
- package/dist/capabilities/alerts.cap.d.ts.map +1 -0
- package/dist/capabilities/audio-analysis.cap.d.ts +46 -0
- package/dist/capabilities/audio-analysis.cap.d.ts.map +1 -0
- package/dist/capabilities/audio-analyzer.cap.d.ts +148 -0
- package/dist/capabilities/audio-analyzer.cap.d.ts.map +1 -0
- package/dist/capabilities/audio-codec.cap.d.ts +202 -0
- package/dist/capabilities/audio-codec.cap.d.ts.map +1 -0
- package/dist/capabilities/audio-metrics.cap.d.ts +174 -0
- package/dist/capabilities/audio-metrics.cap.d.ts.map +1 -0
- package/dist/capabilities/auth-provider.cap.d.ts +49 -0
- package/dist/capabilities/auth-provider.cap.d.ts.map +1 -0
- package/dist/capabilities/authentication.cap.d.ts +83 -0
- package/dist/capabilities/authentication.cap.d.ts.map +1 -0
- package/dist/capabilities/backup.cap.d.ts +269 -0
- package/dist/capabilities/backup.cap.d.ts.map +1 -0
- package/dist/capabilities/battery.cap.d.ts +85 -0
- package/dist/capabilities/battery.cap.d.ts.map +1 -0
- package/dist/capabilities/brightness.cap.d.ts +64 -0
- package/dist/capabilities/brightness.cap.d.ts.map +1 -0
- package/dist/capabilities/camera-credentials.cap.d.ts +102 -0
- package/dist/capabilities/camera-credentials.cap.d.ts.map +1 -0
- package/dist/capabilities/camera-streams.cap.d.ts +214 -0
- package/dist/capabilities/camera-streams.cap.d.ts.map +1 -0
- package/dist/capabilities/capability-definition.d.ts +474 -0
- package/dist/capabilities/capability-definition.d.ts.map +1 -0
- package/dist/capabilities/custom-actions.d.ts +47 -0
- package/dist/capabilities/custom-actions.d.ts.map +1 -0
- package/dist/capabilities/decoder.cap.d.ts +173 -0
- package/dist/capabilities/decoder.cap.d.ts.map +1 -0
- package/dist/capabilities/detection-pipeline.cap.d.ts +34 -0
- package/dist/capabilities/detection-pipeline.cap.d.ts.map +1 -0
- package/dist/capabilities/device-discovery.cap.d.ts +247 -0
- package/dist/capabilities/device-discovery.cap.d.ts.map +1 -0
- package/dist/capabilities/device-manager.cap.d.ts +709 -0
- package/dist/capabilities/device-manager.cap.d.ts.map +1 -0
- package/dist/capabilities/device-ops.cap.d.ts +87 -0
- package/dist/capabilities/device-ops.cap.d.ts.map +1 -0
- package/dist/capabilities/device-provider.cap.d.ts +151 -0
- package/dist/capabilities/device-provider.cap.d.ts.map +1 -0
- package/dist/capabilities/device-state.cap.d.ts +97 -0
- package/dist/capabilities/device-state.cap.d.ts.map +1 -0
- package/dist/capabilities/device-status.cap.d.ts +54 -0
- package/dist/capabilities/device-status.cap.d.ts.map +1 -0
- package/dist/capabilities/doorbell.cap.d.ts +62 -0
- package/dist/capabilities/doorbell.cap.d.ts.map +1 -0
- package/dist/capabilities/embedding-encoder.cap.d.ts +41 -0
- package/dist/capabilities/embedding-encoder.cap.d.ts.map +1 -0
- package/dist/capabilities/events.cap.d.ts +48 -0
- package/dist/capabilities/events.cap.d.ts.map +1 -0
- package/dist/capabilities/feature-probe.cap.d.ts +79 -0
- package/dist/capabilities/feature-probe.cap.d.ts.map +1 -0
- package/dist/capabilities/index.d.ts +191 -0
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/integrations.cap.d.ts +182 -0
- package/dist/capabilities/integrations.cap.d.ts.map +1 -0
- package/dist/capabilities/intercom.cap.d.ts +108 -0
- package/dist/capabilities/intercom.cap.d.ts.map +1 -0
- package/dist/capabilities/local-network.cap.d.ts +216 -0
- package/dist/capabilities/local-network.cap.d.ts.map +1 -0
- package/dist/capabilities/log-destination.cap.d.ts +70 -0
- package/dist/capabilities/log-destination.cap.d.ts.map +1 -0
- package/dist/capabilities/mesh-network.cap.d.ts +160 -0
- package/dist/capabilities/mesh-network.cap.d.ts.map +1 -0
- package/dist/capabilities/mesh-orchestrator.cap.d.ts +96 -0
- package/dist/capabilities/mesh-orchestrator.cap.d.ts.map +1 -0
- package/dist/capabilities/metrics-provider.cap.d.ts +522 -0
- package/dist/capabilities/metrics-provider.cap.d.ts.map +1 -0
- package/dist/capabilities/motion-detection.cap.d.ts +107 -0
- package/dist/capabilities/motion-detection.cap.d.ts.map +1 -0
- package/dist/capabilities/motion-trigger.cap.d.ts +78 -0
- package/dist/capabilities/motion-trigger.cap.d.ts.map +1 -0
- package/dist/capabilities/motion.cap.d.ts +122 -0
- package/dist/capabilities/motion.cap.d.ts.map +1 -0
- package/dist/capabilities/native-object-detection.cap.d.ts +127 -0
- package/dist/capabilities/native-object-detection.cap.d.ts.map +1 -0
- package/dist/capabilities/network-access.cap.d.ts +67 -0
- package/dist/capabilities/network-access.cap.d.ts.map +1 -0
- package/dist/capabilities/network-quality.cap.d.ts +95 -0
- package/dist/capabilities/network-quality.cap.d.ts.map +1 -0
- package/dist/capabilities/nodes.cap.d.ts +200 -0
- package/dist/capabilities/nodes.cap.d.ts.map +1 -0
- package/dist/capabilities/notification-output.cap.d.ts +44 -0
- package/dist/capabilities/notification-output.cap.d.ts.map +1 -0
- package/dist/capabilities/osd.cap.d.ts +236 -0
- package/dist/capabilities/osd.cap.d.ts.map +1 -0
- package/dist/capabilities/pipeline-analytics.cap.d.ts +501 -0
- package/dist/capabilities/pipeline-analytics.cap.d.ts.map +1 -0
- package/dist/capabilities/pipeline-executor.cap.d.ts +922 -0
- package/dist/capabilities/pipeline-executor.cap.d.ts.map +1 -0
- package/dist/capabilities/pipeline-orchestrator.cap.d.ts +793 -0
- package/dist/capabilities/pipeline-orchestrator.cap.d.ts.map +1 -0
- package/dist/capabilities/pipeline-runner.cap.d.ts +393 -0
- package/dist/capabilities/pipeline-runner.cap.d.ts.map +1 -0
- package/dist/capabilities/platform-probe.cap.d.ts +168 -0
- package/dist/capabilities/platform-probe.cap.d.ts.map +1 -0
- package/dist/capabilities/ptz-autotrack.cap.d.ts +188 -0
- package/dist/capabilities/ptz-autotrack.cap.d.ts.map +1 -0
- package/dist/capabilities/ptz.cap.d.ts +80 -0
- package/dist/capabilities/ptz.cap.d.ts.map +1 -0
- package/dist/capabilities/reboot.cap.d.ts +32 -0
- package/dist/capabilities/reboot.cap.d.ts.map +1 -0
- package/dist/capabilities/recording-engine.cap.d.ts +477 -0
- package/dist/capabilities/recording-engine.cap.d.ts.map +1 -0
- package/dist/capabilities/recording.cap.d.ts +43 -0
- package/dist/capabilities/recording.cap.d.ts.map +1 -0
- package/dist/capabilities/remote-access.cap.d.ts +103 -0
- package/dist/capabilities/remote-access.cap.d.ts.map +1 -0
- package/dist/capabilities/restreamer.cap.d.ts +51 -0
- package/dist/capabilities/restreamer.cap.d.ts.map +1 -0
- package/dist/capabilities/schemas/detection-shared.d.ts +63 -0
- package/dist/capabilities/schemas/detection-shared.d.ts.map +1 -0
- package/dist/capabilities/schemas/orchestrator-metrics.d.ts +44 -0
- package/dist/capabilities/schemas/orchestrator-metrics.d.ts.map +1 -0
- package/dist/capabilities/schemas/streaming-shared.d.ts +177 -0
- package/dist/capabilities/schemas/streaming-shared.d.ts.map +1 -0
- package/dist/capabilities/schemas/zone-rule.d.ts +74 -0
- package/dist/capabilities/schemas/zone-rule.d.ts.map +1 -0
- package/dist/capabilities/settings-store.cap.d.ts +198 -0
- package/dist/capabilities/settings-store.cap.d.ts.map +1 -0
- package/dist/capabilities/snapshot-provider.cap.d.ts +40 -0
- package/dist/capabilities/snapshot-provider.cap.d.ts.map +1 -0
- package/dist/capabilities/snapshot.cap.d.ts +78 -0
- package/dist/capabilities/snapshot.cap.d.ts.map +1 -0
- package/dist/capabilities/storage-provider.cap.d.ts +432 -0
- package/dist/capabilities/storage-provider.cap.d.ts.map +1 -0
- package/dist/capabilities/storage.cap.d.ts +367 -0
- package/dist/capabilities/storage.cap.d.ts.map +1 -0
- package/dist/capabilities/stream-broker.cap.d.ts +416 -0
- package/dist/capabilities/stream-broker.cap.d.ts.map +1 -0
- package/dist/capabilities/streaming-engine.cap.d.ts +58 -0
- package/dist/capabilities/streaming-engine.cap.d.ts.map +1 -0
- package/dist/capabilities/switch.cap.d.ts +66 -0
- package/dist/capabilities/switch.cap.d.ts.map +1 -0
- package/dist/capabilities/system.cap.d.ts +86 -0
- package/dist/capabilities/system.cap.d.ts.map +1 -0
- package/dist/capabilities/toast.cap.d.ts +56 -0
- package/dist/capabilities/toast.cap.d.ts.map +1 -0
- package/dist/capabilities/turn-orchestrator.cap.d.ts +74 -0
- package/dist/capabilities/turn-orchestrator.cap.d.ts.map +1 -0
- package/dist/capabilities/turn-provider.cap.d.ts +43 -0
- package/dist/capabilities/turn-provider.cap.d.ts.map +1 -0
- package/dist/capabilities/user-management.cap.d.ts +378 -0
- package/dist/capabilities/user-management.cap.d.ts.map +1 -0
- package/dist/capabilities/webrtc-session.cap.d.ts +181 -0
- package/dist/capabilities/webrtc-session.cap.d.ts.map +1 -0
- package/dist/capabilities/webrtc.cap.d.ts +72 -0
- package/dist/capabilities/webrtc.cap.d.ts.map +1 -0
- package/dist/capabilities/zone-analytics.cap.d.ts +213 -0
- package/dist/capabilities/zone-analytics.cap.d.ts.map +1 -0
- package/dist/capabilities/zone-rules.cap.d.ts +129 -0
- package/dist/capabilities/zone-rules.cap.d.ts.map +1 -0
- package/dist/capabilities/zones.cap.d.ts +151 -0
- package/dist/capabilities/zones.cap.d.ts.map +1 -0
- package/dist/catalogs/audio-classmap.d.ts +16 -0
- package/dist/catalogs/audio-classmap.d.ts.map +1 -0
- package/dist/catalogs/coco-classmap.d.ts.map +1 -1
- package/dist/constants.d.ts +50 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/deps/binary-downloader.d.ts +41 -0
- package/dist/deps/binary-downloader.d.ts.map +1 -0
- package/dist/deps/ffmpeg-downloader.d.ts +13 -0
- package/dist/deps/ffmpeg-downloader.d.ts.map +1 -0
- package/dist/deps/index.d.ts +4 -0
- package/dist/deps/index.d.ts.map +1 -0
- package/dist/deps/python-downloader.d.ts +34 -0
- package/dist/deps/python-downloader.d.ts.map +1 -0
- package/dist/device/accessory.d.ts +62 -0
- package/dist/device/accessory.d.ts.map +1 -0
- package/dist/device/base-device-provider.d.ts +178 -0
- package/dist/device/base-device-provider.d.ts.map +1 -0
- package/dist/device/base-device.d.ts +287 -0
- package/dist/device/base-device.d.ts.map +1 -0
- package/dist/device/camera-device.d.ts +49 -0
- package/dist/device/camera-device.d.ts.map +1 -0
- package/dist/device/device-binding.d.ts +23 -0
- package/dist/device/device-binding.d.ts.map +1 -0
- package/dist/device/device-config.d.ts +65 -0
- package/dist/device/device-config.d.ts.map +1 -0
- package/dist/device/device-context.d.ts +256 -0
- package/dist/device/device-context.d.ts.map +1 -0
- package/dist/device/device-management.d.ts +118 -0
- package/dist/device/device-management.d.ts.map +1 -0
- package/dist/device/device-profile.d.ts +161 -0
- package/dist/device/device-profile.d.ts.map +1 -0
- package/dist/device/device-runtime-state.d.ts +124 -0
- package/dist/device/device-runtime-state.d.ts.map +1 -0
- package/dist/device/device-state-handle.d.ts +161 -0
- package/dist/device/device-state-handle.d.ts.map +1 -0
- package/dist/device/device-type.d.ts +68 -0
- package/dist/device/device-type.d.ts.map +1 -0
- package/dist/device/device.d.ts +87 -0
- package/dist/device/device.d.ts.map +1 -0
- package/dist/device/features.d.ts +29 -0
- package/dist/device/features.d.ts.map +1 -0
- package/dist/device/index.d.ts +20 -0
- package/dist/device/index.d.ts.map +1 -0
- package/dist/device/runtime-state-helpers.d.ts +69 -0
- package/dist/device/runtime-state-helpers.d.ts.map +1 -0
- package/dist/device/system-mirror.d.ts +318 -0
- package/dist/device/system-mirror.d.ts.map +1 -0
- package/dist/device/zod-to-config-ui.d.ts +23 -0
- package/dist/device/zod-to-config-ui.d.ts.map +1 -0
- package/dist/disposer-chain.d.ts +32 -0
- package/dist/disposer-chain.d.ts.map +1 -0
- package/dist/enums/event-category.d.ts +361 -0
- package/dist/enums/event-category.d.ts.map +1 -0
- package/dist/enums/event-source-type.d.ts +8 -0
- package/dist/enums/event-source-type.d.ts.map +1 -0
- package/dist/enums/index.d.ts +3 -0
- package/dist/enums/index.d.ts.map +1 -0
- package/dist/generated/addon-api.d.ts +14604 -3217
- package/dist/generated/addon-api.d.ts.map +1 -1
- package/dist/generated/cap-status-types.d.ts +51 -0
- package/dist/generated/cap-status-types.d.ts.map +1 -0
- package/dist/generated/capability-router-map.d.ts +278 -0
- package/dist/generated/capability-router-map.d.ts.map +1 -0
- package/dist/generated/device-local-state.d.ts +82 -0
- package/dist/generated/device-local-state.d.ts.map +1 -0
- package/dist/generated/device-proxy.d.ts +146 -0
- package/dist/generated/device-proxy.d.ts.map +1 -0
- package/dist/generated/system-proxy.d.ts +92 -0
- package/dist/generated/system-proxy.d.ts.map +1 -0
- package/dist/helpers/bind-addon-actions.d.ts +19 -0
- package/dist/helpers/bind-addon-actions.d.ts.map +1 -0
- package/dist/index.d.ts +91 -22
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4843 -477
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4832 -415
- package/dist/index.mjs.map +1 -1
- package/dist/interfaces/addon.d.ts +760 -132
- package/dist/interfaces/addon.d.ts.map +1 -1
- package/dist/interfaces/advanced-notifier.d.ts +3 -2
- package/dist/interfaces/advanced-notifier.d.ts.map +1 -1
- package/dist/interfaces/agent-protocol.d.ts +17 -173
- package/dist/interfaces/agent-protocol.d.ts.map +1 -1
- package/dist/interfaces/agent.d.ts +61 -0
- package/dist/interfaces/agent.d.ts.map +1 -1
- package/dist/interfaces/alerts.d.ts +14 -0
- package/dist/interfaces/alerts.d.ts.map +1 -0
- package/dist/interfaces/analysis-persistence.d.ts +37 -19
- package/dist/interfaces/analysis-persistence.d.ts.map +1 -1
- package/dist/interfaces/analysis.d.ts +33 -4
- package/dist/interfaces/analysis.d.ts.map +1 -1
- package/dist/interfaces/api-responses.d.ts +124 -0
- package/dist/interfaces/api-responses.d.ts.map +1 -0
- package/dist/interfaces/api-shared.d.ts +5 -79
- package/dist/interfaces/api-shared.d.ts.map +1 -1
- package/dist/interfaces/audio-analyzer.d.ts +49 -0
- package/dist/interfaces/audio-analyzer.d.ts.map +1 -0
- package/dist/interfaces/audio-codec.d.ts +123 -0
- package/dist/interfaces/audio-codec.d.ts.map +1 -0
- package/dist/interfaces/audio-inference-engine.d.ts +19 -0
- package/dist/interfaces/audio-inference-engine.d.ts.map +1 -0
- package/dist/interfaces/auth-provider.d.ts.map +1 -1
- package/dist/interfaces/auth.d.ts +4 -25
- package/dist/interfaces/auth.d.ts.map +1 -1
- package/dist/interfaces/camera-pipeline.d.ts +7 -20
- package/dist/interfaces/camera-pipeline.d.ts.map +1 -1
- package/dist/interfaces/capability.d.ts +171 -24
- package/dist/interfaces/capability.d.ts.map +1 -1
- package/dist/interfaces/config-ui.d.ts +746 -24
- package/dist/interfaces/config-ui.d.ts.map +1 -1
- package/dist/interfaces/context.d.ts +9 -4
- package/dist/interfaces/context.d.ts.map +1 -1
- package/dist/interfaces/decoder.d.ts +38 -3
- package/dist/interfaces/decoder.d.ts.map +1 -1
- package/dist/interfaces/detection-addon.d.ts +6 -6
- package/dist/interfaces/detection-addon.d.ts.map +1 -1
- package/dist/interfaces/device-capabilities/camera.d.ts +95 -18
- package/dist/interfaces/device-capabilities/camera.d.ts.map +1 -1
- package/dist/interfaces/device-capabilities/index.d.ts +0 -13
- package/dist/interfaces/device-capabilities/index.d.ts.map +1 -1
- package/dist/interfaces/device-provider.d.ts +18 -16
- package/dist/interfaces/device-provider.d.ts.map +1 -1
- package/dist/interfaces/device.d.ts +4 -21
- package/dist/interfaces/device.d.ts.map +1 -1
- package/dist/interfaces/embedding-encoder.d.ts +19 -0
- package/dist/interfaces/embedding-encoder.d.ts.map +1 -0
- package/dist/interfaces/engine-slots.d.ts +10 -0
- package/dist/interfaces/engine-slots.d.ts.map +1 -0
- package/dist/interfaces/event-bus.d.ts +710 -26
- package/dist/interfaces/event-bus.d.ts.map +1 -1
- package/dist/interfaces/inference-capabilities.d.ts +0 -17
- package/dist/interfaces/inference-capabilities.d.ts.map +1 -1
- package/dist/interfaces/inference-engine.d.ts +30 -10
- package/dist/interfaces/inference-engine.d.ts.map +1 -1
- package/dist/interfaces/integration-registry.d.ts +20 -20
- package/dist/interfaces/integration-registry.d.ts.map +1 -1
- package/dist/interfaces/kernel-abstractions.d.ts +83 -0
- package/dist/interfaces/kernel-abstractions.d.ts.map +1 -0
- package/dist/interfaces/logging.d.ts +89 -8
- package/dist/interfaces/logging.d.ts.map +1 -1
- package/dist/interfaces/metrics-provider.d.ts +17 -0
- package/dist/interfaces/metrics-provider.d.ts.map +1 -0
- package/dist/interfaces/network-quality.d.ts +4 -4
- package/dist/interfaces/network.d.ts +0 -16
- package/dist/interfaces/network.d.ts.map +1 -1
- package/dist/interfaces/notification.d.ts +1 -1
- package/dist/interfaces/pipeline-executor-capability.d.ts +200 -0
- package/dist/interfaces/pipeline-executor-capability.d.ts.map +1 -0
- package/dist/interfaces/pipeline-orchestrator-capability.d.ts +165 -0
- package/dist/interfaces/pipeline-orchestrator-capability.d.ts.map +1 -0
- package/dist/interfaces/pipeline-runner-capability.d.ts +147 -0
- package/dist/interfaces/pipeline-runner-capability.d.ts.map +1 -0
- package/dist/interfaces/pipeline-runner.d.ts +18 -2
- package/dist/interfaces/pipeline-runner.d.ts.map +1 -1
- package/dist/interfaces/platform.d.ts +1 -1
- package/dist/interfaces/platform.d.ts.map +1 -1
- package/dist/interfaces/queryable.d.ts +26 -0
- package/dist/interfaces/queryable.d.ts.map +1 -0
- package/dist/interfaces/raw-tensor-engine.d.ts +16 -0
- package/dist/interfaces/raw-tensor-engine.d.ts.map +1 -0
- package/dist/interfaces/readiness.d.ts +101 -0
- package/dist/interfaces/readiness.d.ts.map +1 -0
- package/dist/interfaces/repl.d.ts +1 -1
- package/dist/interfaces/restreamer.d.ts +3 -3
- package/dist/interfaces/scoped-token.d.ts +1 -21
- package/dist/interfaces/scoped-token.d.ts.map +1 -1
- package/dist/interfaces/server-analysis.d.ts +30 -87
- package/dist/interfaces/server-analysis.d.ts.map +1 -1
- package/dist/interfaces/storage-location.d.ts +120 -0
- package/dist/interfaces/storage-location.d.ts.map +1 -0
- package/dist/interfaces/storage.d.ts +124 -50
- package/dist/interfaces/storage.d.ts.map +1 -1
- package/dist/interfaces/stream-broker.d.ts +285 -17
- package/dist/interfaces/stream-broker.d.ts.map +1 -1
- package/dist/interfaces/webrtc-provider.d.ts +24 -0
- package/dist/interfaces/webrtc-provider.d.ts.map +1 -1
- package/dist/node.d.ts +6 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +481 -0
- package/dist/node.js.map +1 -0
- package/dist/node.mjs +443 -0
- package/dist/node.mjs.map +1 -0
- package/dist/readiness/index.d.ts +3 -0
- package/dist/readiness/index.d.ts.map +1 -0
- package/dist/readiness/readiness-registry.d.ts +183 -0
- package/dist/readiness/readiness-registry.d.ts.map +1 -0
- package/dist/schemas/auth-records.d.ts +81 -0
- package/dist/schemas/auth-records.d.ts.map +1 -0
- package/dist/storage/filesystem-storage-provider.d.ts +37 -0
- package/dist/storage/filesystem-storage-provider.d.ts.map +1 -0
- package/dist/types/agent-pipeline-settings.d.ts +94 -0
- package/dist/types/agent-pipeline-settings.d.ts.map +1 -0
- package/dist/types/camera-pipeline.d.ts +58 -0
- package/dist/types/camera-pipeline.d.ts.map +1 -0
- package/dist/types/detection.d.ts +195 -38
- package/dist/types/detection.d.ts.map +1 -1
- package/dist/types/device-type.d.ts +4 -0
- package/dist/types/device-type.d.ts.map +1 -1
- package/dist/types/engine-output.d.ts +24 -0
- package/dist/types/engine-output.d.ts.map +1 -0
- package/dist/types/io.d.ts +57 -3
- package/dist/types/io.d.ts.map +1 -1
- package/dist/types/models.d.ts +3 -1
- package/dist/types/models.d.ts.map +1 -1
- package/dist/types/pipeline-schema.d.ts +15 -72
- package/dist/types/pipeline-schema.d.ts.map +1 -1
- package/dist/types/pipeline-step.d.ts +201 -0
- package/dist/types/pipeline-step.d.ts.map +1 -0
- package/dist/types/pipeline.d.ts +24 -1
- package/dist/types/pipeline.d.ts.map +1 -1
- package/dist/utils/element-config-store.d.ts +29 -0
- package/dist/utils/element-config-store.d.ts.map +1 -0
- package/dist/utils/err-msg.d.ts +7 -0
- package/dist/utils/err-msg.d.ts.map +1 -0
- package/dist/utils/json-safe.d.ts +33 -0
- package/dist/utils/json-safe.d.ts.map +1 -0
- package/dist/utils/mask-url.d.ts +10 -0
- package/dist/utils/mask-url.d.ts.map +1 -0
- package/dist/utils/ring-buffer.d.ts +16 -0
- package/dist/utils/ring-buffer.d.ts.map +1 -0
- package/dist/utils/run-inference-step.d.ts +26 -0
- package/dist/utils/run-inference-step.d.ts.map +1 -0
- package/dist/utils/runtime-mapping.d.ts +88 -0
- package/dist/utils/runtime-mapping.d.ts.map +1 -0
- package/dist/utils/zone-rule-eval.d.ts +47 -0
- package/dist/utils/zone-rule-eval.d.ts.map +1 -0
- package/package.json +11 -2
- package/dist/__tests__/addon-capability-provider.test.d.ts +0 -2
- package/dist/__tests__/addon-capability-provider.test.d.ts.map +0 -1
- package/dist/__tests__/addon-declaration.test.d.ts +0 -2
- package/dist/__tests__/addon-declaration.test.d.ts.map +0 -1
- package/dist/__tests__/capability.test.d.ts +0 -2
- package/dist/__tests__/capability.test.d.ts.map +0 -1
- package/dist/interfaces/addon-i18n.d.ts +0 -41
- package/dist/interfaces/addon-i18n.d.ts.map +0 -1
- package/dist/interfaces/classifier.d.ts +0 -8
- package/dist/interfaces/classifier.d.ts.map +0 -1
- package/dist/interfaces/cropper.d.ts +0 -8
- package/dist/interfaces/cropper.d.ts.map +0 -1
- package/dist/interfaces/detector.d.ts +0 -8
- package/dist/interfaces/detector.d.ts.map +0 -1
- package/dist/interfaces/device-capabilities/accessory.d.ts +0 -14
- package/dist/interfaces/device-capabilities/accessory.d.ts.map +0 -1
- package/dist/interfaces/device-capabilities/audio-detector.d.ts +0 -12
- package/dist/interfaces/device-capabilities/audio-detector.d.ts.map +0 -1
- package/dist/interfaces/device-capabilities/doorbell.d.ts +0 -10
- package/dist/interfaces/device-capabilities/doorbell.d.ts.map +0 -1
- package/dist/interfaces/device-capabilities/events.d.ts +0 -47
- package/dist/interfaces/device-capabilities/events.d.ts.map +0 -1
- package/dist/interfaces/device-capabilities/motion-sensor.d.ts +0 -7
- package/dist/interfaces/device-capabilities/motion-sensor.d.ts.map +0 -1
- package/dist/interfaces/device-capabilities/native-detection.d.ts +0 -14
- package/dist/interfaces/device-capabilities/native-detection.d.ts.map +0 -1
- package/dist/interfaces/device-capabilities/object-detector.d.ts +0 -59
- package/dist/interfaces/device-capabilities/object-detector.d.ts.map +0 -1
- package/dist/interfaces/device-capabilities/pan-tilt-zoom.d.ts +0 -29
- package/dist/interfaces/device-capabilities/pan-tilt-zoom.d.ts.map +0 -1
- package/dist/interfaces/device-capabilities/recording.d.ts +0 -18
- package/dist/interfaces/device-capabilities/recording.d.ts.map +0 -1
- package/dist/interfaces/device-capabilities/siren.d.ts +0 -8
- package/dist/interfaces/device-capabilities/siren.d.ts.map +0 -1
- package/dist/interfaces/device-capabilities/status-light.d.ts +0 -7
- package/dist/interfaces/device-capabilities/status-light.d.ts.map +0 -1
- package/dist/interfaces/device-capabilities/switch.d.ts +0 -8
- package/dist/interfaces/device-capabilities/switch.d.ts.map +0 -1
- package/dist/interfaces/device-capabilities/two-way-audio.d.ts +0 -8
- package/dist/interfaces/device-capabilities/two-way-audio.d.ts.map +0 -1
- package/dist/interfaces/device-capability.d.ts +0 -14
- package/dist/interfaces/device-capability.d.ts.map +0 -1
- package/dist/interfaces/model-catalog.d.ts +0 -25
- package/dist/interfaces/model-catalog.d.ts.map +0 -1
- package/dist/interfaces/refiner.d.ts +0 -8
- package/dist/interfaces/refiner.d.ts.map +0 -1
- package/dist/interfaces/repositories.d.ts +0 -20
- package/dist/interfaces/repositories.d.ts.map +0 -1
- package/dist/interfaces/scene-intelligence.d.ts +0 -21
- package/dist/interfaces/scene-intelligence.d.ts.map +0 -1
- package/dist/interfaces/storage-backend.d.ts +0 -27
- package/dist/interfaces/storage-backend.d.ts.map +0 -1
- package/dist/interfaces/worker-protocol.d.ts +0 -110
- package/dist/interfaces/worker-protocol.d.ts.map +0 -1
- package/dist/schemas/system-settings-schemas.d.ts +0 -27
- package/dist/schemas/system-settings-schemas.d.ts.map +0 -1
- package/dist/types/benchmark.d.ts +0 -112
- package/dist/types/benchmark.d.ts.map +0 -1
- package/dist/types/zones.d.ts +0 -48
- package/dist/types/zones.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream-broker.d.ts","sourceRoot":"","sources":["../../src/interfaces/stream-broker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stream-broker.d.ts","sourceRoot":"","sources":["../../src/interfaces/stream-broker.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAIjD,eAAO,MAAM,kBAAkB;;;;;iBAK7B,CAAA;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;iBAsBrC,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,MAAM,IAAI,CAAA;AAEpC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,aAAa,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;AAEhH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAA;IAC/B,4FAA4F;IAC5F,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;IACrD;;;;;;;OAOG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAC9B;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAA;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE;QAAE,QA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,6BAA6B,EAAE,iBAAiB,CAAA;IAC/E,QAAQ,CAAC,SAAS,EAAE,OAAO,6BAA6B,EAAE,iBAAiB,CAAA;CAC5E"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { EncodedPacket } from './stream-broker.js';
|
|
2
|
+
import type { WebrtcClientHints } from '../capabilities/webrtc.cap.js';
|
|
2
3
|
export interface IWebRtcProvider {
|
|
3
4
|
readonly id: string;
|
|
4
5
|
readonly name: string;
|
|
@@ -7,5 +8,28 @@ export interface IWebRtcProvider {
|
|
|
7
8
|
registerStream(streamId: string, codec: string): Promise<void>;
|
|
8
9
|
pushPacket(streamId: string, packet: EncodedPacket): void;
|
|
9
10
|
unregisterStream(streamId: string): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Server-offer signaling: create a session and return the server SDP
|
|
13
|
+
* offer. Single-object signature matches `InferProvider<>` so the
|
|
14
|
+
* generated cap-router can dispatch directly. `hints` is optional
|
|
15
|
+
* client metadata (viewport, downlink) the provider can use to pick
|
|
16
|
+
* the best native source.
|
|
17
|
+
*/
|
|
18
|
+
createSession?(input: {
|
|
19
|
+
streamId: string;
|
|
20
|
+
hints?: WebrtcClientHints;
|
|
21
|
+
}): Promise<{
|
|
22
|
+
sessionId: string;
|
|
23
|
+
sdpOffer: string;
|
|
24
|
+
}>;
|
|
25
|
+
/** Server-offer signaling: accept the client SDP answer for a session. */
|
|
26
|
+
handleAnswer?(input: {
|
|
27
|
+
sessionId: string;
|
|
28
|
+
sdpAnswer: string;
|
|
29
|
+
}): Promise<void>;
|
|
30
|
+
/** Explicitly close a WebRTC session (called on client disconnect). */
|
|
31
|
+
closeSession?(input: {
|
|
32
|
+
sessionId: string;
|
|
33
|
+
}): Promise<void>;
|
|
10
34
|
}
|
|
11
35
|
//# sourceMappingURL=webrtc-provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webrtc-provider.d.ts","sourceRoot":"","sources":["../../src/interfaces/webrtc-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AAK,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3D"}
|
package/dist/node.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { ensureBinary, downloadBinary, findInPath, getPlatformInfo, buildBinaryPath, } from './deps/binary-downloader.js';
|
|
2
|
+
export type { PlatformInfo } from './deps/binary-downloader.js';
|
|
3
|
+
export { ensureFfmpeg, getFfmpegDownloadUrl } from './deps/ffmpeg-downloader.js';
|
|
4
|
+
export { ensurePython, installPythonPackages, installPythonRequirements, getPythonDownloadUrl, PYTHON_VERSION, } from './deps/python-downloader.js';
|
|
5
|
+
export { FilesystemStorageProvider } from './storage/filesystem-storage-provider.js';
|
|
6
|
+
//# sourceMappingURL=node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,YAAY,EACZ,cAAc,EACd,UAAU,EACV,eAAe,EACf,eAAe,GAChB,MAAM,6BAA6B,CAAA;AACpC,YAAY,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAC/D,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAChF,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,cAAc,GACf,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAA"}
|
package/dist/node.js
ADDED
|
@@ -0,0 +1,481 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
25
|
+
const fs = require("node:fs");
|
|
26
|
+
const path = require("node:path");
|
|
27
|
+
const promises = require("node:stream/promises");
|
|
28
|
+
const node_stream = require("node:stream");
|
|
29
|
+
const node_child_process = require("node:child_process");
|
|
30
|
+
const node_crypto = require("node:crypto");
|
|
31
|
+
const authRecords = require("./auth-records-D5ZNaUos.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);
|
|
51
|
+
function getPlatformInfo() {
|
|
52
|
+
return {
|
|
53
|
+
platform: process.platform,
|
|
54
|
+
arch: process.arch
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function buildBinaryPath(dataDir, name, platform) {
|
|
58
|
+
const ext = (platform ?? process.platform) === "win32" ? ".exe" : "";
|
|
59
|
+
return path.join(dataDir, "deps", `${name}${ext}`);
|
|
60
|
+
}
|
|
61
|
+
function findInPath(name) {
|
|
62
|
+
try {
|
|
63
|
+
node_child_process.execFileSync(name, ["--version"], { stdio: "pipe", timeout: 5e3 });
|
|
64
|
+
return name;
|
|
65
|
+
} catch {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
async function downloadBinary(opts) {
|
|
70
|
+
const { name, url, targetDir, targetName, logger, isArchive, archiveFormat, archiveInnerPath } = opts;
|
|
71
|
+
const targetPath = path.join(targetDir, targetName);
|
|
72
|
+
if (fs.existsSync(targetPath)) {
|
|
73
|
+
logger.debug("Binary already exists", { meta: { name, targetPath } });
|
|
74
|
+
return targetPath;
|
|
75
|
+
}
|
|
76
|
+
fs.mkdirSync(targetDir, { recursive: true });
|
|
77
|
+
logger.info("Downloading binary", { meta: { name, url } });
|
|
78
|
+
const response = await fetch(url, { redirect: "follow" });
|
|
79
|
+
if (!response.ok || !response.body) {
|
|
80
|
+
throw new Error(`Failed to download ${name}: ${response.status} ${response.statusText}`);
|
|
81
|
+
}
|
|
82
|
+
if (isArchive) {
|
|
83
|
+
const ext = archiveFormat ?? "tar.gz";
|
|
84
|
+
const tmpArchive = path.join(targetDir, `${name}-download.${ext}`);
|
|
85
|
+
const nodeStream = node_stream.Readable.fromWeb(response.body);
|
|
86
|
+
await promises.pipeline(nodeStream, fs.createWriteStream(tmpArchive));
|
|
87
|
+
const tmpExtractDir = path.join(targetDir, `${name}-extract`);
|
|
88
|
+
fs.mkdirSync(tmpExtractDir, { recursive: true });
|
|
89
|
+
if (ext === "zip") {
|
|
90
|
+
try {
|
|
91
|
+
node_child_process.execFileSync("unzip", ["-o", "-q", tmpArchive, "-d", tmpExtractDir], { stdio: "pipe" });
|
|
92
|
+
} catch {
|
|
93
|
+
node_child_process.execFileSync("tar", ["-xf", tmpArchive, "-C", tmpExtractDir], { stdio: "pipe" });
|
|
94
|
+
}
|
|
95
|
+
} else if (ext === "tar.xz") {
|
|
96
|
+
node_child_process.execFileSync("tar", ["-xJf", tmpArchive, "-C", tmpExtractDir], { stdio: "pipe" });
|
|
97
|
+
} else {
|
|
98
|
+
node_child_process.execFileSync("tar", ["-xzf", tmpArchive, "-C", tmpExtractDir], { stdio: "pipe" });
|
|
99
|
+
}
|
|
100
|
+
if (archiveInnerPath) {
|
|
101
|
+
const { copyFileSync } = await import("node:fs");
|
|
102
|
+
const sourcePath = path.join(tmpExtractDir, archiveInnerPath);
|
|
103
|
+
if (!fs.existsSync(sourcePath)) {
|
|
104
|
+
throw new Error(`Binary not found in archive at ${archiveInnerPath}`);
|
|
105
|
+
}
|
|
106
|
+
copyFileSync(sourcePath, targetPath);
|
|
107
|
+
}
|
|
108
|
+
fs.unlinkSync(tmpArchive);
|
|
109
|
+
const { rmSync } = await import("node:fs");
|
|
110
|
+
rmSync(tmpExtractDir, { recursive: true, force: true });
|
|
111
|
+
} else {
|
|
112
|
+
const nodeStream = node_stream.Readable.fromWeb(response.body);
|
|
113
|
+
await promises.pipeline(nodeStream, fs.createWriteStream(targetPath));
|
|
114
|
+
}
|
|
115
|
+
fs.chmodSync(targetPath, 493);
|
|
116
|
+
logger.info("Binary downloaded", { meta: { name, targetPath } });
|
|
117
|
+
return targetPath;
|
|
118
|
+
}
|
|
119
|
+
async function ensureBinary(opts) {
|
|
120
|
+
const ext = process.platform === "win32" ? ".exe" : "";
|
|
121
|
+
const targetName = `${opts.name}${ext}`;
|
|
122
|
+
const targetPath = path.join(opts.targetDir, targetName);
|
|
123
|
+
if (fs.existsSync(targetPath)) {
|
|
124
|
+
opts.logger.debug("Binary found at target path", { meta: { name: opts.name, targetPath } });
|
|
125
|
+
return targetPath;
|
|
126
|
+
}
|
|
127
|
+
const inPath = findInPath(opts.name);
|
|
128
|
+
if (inPath) {
|
|
129
|
+
opts.logger.info("Binary found in system PATH", { meta: { name: opts.name } });
|
|
130
|
+
return inPath;
|
|
131
|
+
}
|
|
132
|
+
return downloadBinary({
|
|
133
|
+
name: opts.name,
|
|
134
|
+
url: opts.downloadUrl,
|
|
135
|
+
targetDir: opts.targetDir,
|
|
136
|
+
targetName,
|
|
137
|
+
logger: opts.logger,
|
|
138
|
+
isArchive: opts.isArchive,
|
|
139
|
+
archiveFormat: opts.archiveFormat,
|
|
140
|
+
archiveInnerPath: opts.archiveInnerPath
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
const FFMPEG_VERSION = "7.1";
|
|
144
|
+
function getFfmpegDownloadUrl(platform, arch) {
|
|
145
|
+
switch (platform) {
|
|
146
|
+
case "linux": {
|
|
147
|
+
const archMap = { x64: "amd64", arm64: "arm64" };
|
|
148
|
+
const a = archMap[arch];
|
|
149
|
+
if (!a) throw new Error(`Unsupported Linux architecture: ${arch}`);
|
|
150
|
+
return `https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-${a}-static.tar.xz`;
|
|
151
|
+
}
|
|
152
|
+
case "darwin": {
|
|
153
|
+
const archMap = { arm64: "arm64", x64: "amd64" };
|
|
154
|
+
const a = archMap[arch];
|
|
155
|
+
if (!a) throw new Error(`Unsupported macOS architecture: ${arch}`);
|
|
156
|
+
return `https://www.osxexperts.net/ffmpeg${FFMPEG_VERSION.replace(".", "")}arm.zip`;
|
|
157
|
+
}
|
|
158
|
+
default:
|
|
159
|
+
throw new Error(`Unsupported platform: ${platform}`);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
function getFfmpegArchiveInfo(platform) {
|
|
163
|
+
switch (platform) {
|
|
164
|
+
case "linux":
|
|
165
|
+
return {
|
|
166
|
+
isArchive: true,
|
|
167
|
+
archiveFormat: "tar.xz",
|
|
168
|
+
archiveInnerPath: `ffmpeg-${FFMPEG_VERSION}-amd64-static/ffmpeg`
|
|
169
|
+
};
|
|
170
|
+
case "darwin":
|
|
171
|
+
return {
|
|
172
|
+
isArchive: true,
|
|
173
|
+
archiveFormat: "zip",
|
|
174
|
+
archiveInnerPath: "ffmpeg"
|
|
175
|
+
};
|
|
176
|
+
default:
|
|
177
|
+
throw new Error(`Unsupported platform: ${platform}`);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
async function ensureFfmpeg(dataDir, logger) {
|
|
181
|
+
const depsDir = path.join(dataDir, "deps");
|
|
182
|
+
const platform = process.platform;
|
|
183
|
+
const arch = process.arch;
|
|
184
|
+
const archiveInfo = getFfmpegArchiveInfo(platform);
|
|
185
|
+
return ensureBinary({
|
|
186
|
+
name: "ffmpeg",
|
|
187
|
+
targetDir: depsDir,
|
|
188
|
+
downloadUrl: getFfmpegDownloadUrl(platform, arch),
|
|
189
|
+
logger,
|
|
190
|
+
...archiveInfo
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
const PYTHON_VERSION = "3.12.12";
|
|
194
|
+
const PP_BASE = `https://github.com/bjia56/portable-python/releases/download/cpython-v${PYTHON_VERSION}-build.0`;
|
|
195
|
+
function getPythonDownloadUrl(platform, arch) {
|
|
196
|
+
switch (platform) {
|
|
197
|
+
case "linux": {
|
|
198
|
+
const archMap = { x64: "x86_64", arm64: "aarch64" };
|
|
199
|
+
const a = archMap[arch];
|
|
200
|
+
if (!a) throw new Error(`Unsupported Linux architecture for Python: ${arch}`);
|
|
201
|
+
return `${PP_BASE}/python-headless-${PYTHON_VERSION}-linux-${a}.zip`;
|
|
202
|
+
}
|
|
203
|
+
case "darwin": {
|
|
204
|
+
return `${PP_BASE}/python-headless-${PYTHON_VERSION}-darwin-universal2.zip`;
|
|
205
|
+
}
|
|
206
|
+
default:
|
|
207
|
+
throw new Error(`Unsupported platform for portable Python: ${platform}`);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
async function ensurePython(dataDir, logger) {
|
|
211
|
+
const pythonDir = path.join(dataDir, "deps", "python");
|
|
212
|
+
const pythonBin = path.join(pythonDir, "bin", "python3");
|
|
213
|
+
if (fs.existsSync(pythonBin)) {
|
|
214
|
+
logger.debug("Portable Python found", { meta: { pythonBin } });
|
|
215
|
+
return pythonBin;
|
|
216
|
+
}
|
|
217
|
+
logger.info("Downloading portable Python (headless)", { meta: { version: PYTHON_VERSION } });
|
|
218
|
+
const depsDir = path.join(dataDir, "deps");
|
|
219
|
+
fs.mkdirSync(depsDir, { recursive: true });
|
|
220
|
+
const url = getPythonDownloadUrl(process.platform, process.arch);
|
|
221
|
+
const tmpArchive = path.join(depsDir, "python-download.zip");
|
|
222
|
+
logger.info("Python download source", { meta: { url } });
|
|
223
|
+
const response = await fetch(url, { redirect: "follow" });
|
|
224
|
+
if (!response.ok || !response.body) {
|
|
225
|
+
logger.warn("Failed to download Python — ML detection will not be available", { meta: { status: response.status } });
|
|
226
|
+
return null;
|
|
227
|
+
}
|
|
228
|
+
const nodeStream = node_stream.Readable.fromWeb(response.body);
|
|
229
|
+
await promises.pipeline(nodeStream, fs.createWriteStream(tmpArchive));
|
|
230
|
+
try {
|
|
231
|
+
node_child_process.execFileSync("unzip", ["-o", "-q", tmpArchive, "-d", depsDir], { stdio: "pipe" });
|
|
232
|
+
} catch {
|
|
233
|
+
node_child_process.execFileSync("python3", ["-m", "zipfile", "-e", tmpArchive, depsDir], { stdio: "pipe" });
|
|
234
|
+
}
|
|
235
|
+
const { unlinkSync } = await import("node:fs");
|
|
236
|
+
unlinkSync(tmpArchive);
|
|
237
|
+
if (!fs.existsSync(pythonBin)) {
|
|
238
|
+
const candidates = fs.readdirSync(depsDir).filter(
|
|
239
|
+
(name) => name.startsWith("python-") && fs.existsSync(path.join(depsDir, name, "bin", "python3"))
|
|
240
|
+
);
|
|
241
|
+
if (candidates.length === 0) {
|
|
242
|
+
logger.warn("Python extraction succeeded but no python3 binary found in any subdir", {
|
|
243
|
+
meta: { depsDir }
|
|
244
|
+
});
|
|
245
|
+
return null;
|
|
246
|
+
}
|
|
247
|
+
const extractedRoot = path.join(depsDir, candidates[0]);
|
|
248
|
+
if (fs.existsSync(pythonDir)) {
|
|
249
|
+
fs.rmSync(pythonDir, { recursive: true, force: true });
|
|
250
|
+
}
|
|
251
|
+
fs.renameSync(extractedRoot, pythonDir);
|
|
252
|
+
}
|
|
253
|
+
if (!fs.existsSync(pythonBin)) {
|
|
254
|
+
logger.warn("Python extraction succeeded but binary not found at expected path", {
|
|
255
|
+
meta: { pythonBin }
|
|
256
|
+
});
|
|
257
|
+
return null;
|
|
258
|
+
}
|
|
259
|
+
fs.chmodSync(pythonBin, 493);
|
|
260
|
+
if (process.platform === "darwin") {
|
|
261
|
+
const realBin = path.join(pythonDir, "bin", "python3.real");
|
|
262
|
+
if (!fs.existsSync(realBin)) {
|
|
263
|
+
fs.renameSync(pythonBin, realBin);
|
|
264
|
+
const archFlag = process.arch === "arm64" ? "-arm64" : "-x86_64";
|
|
265
|
+
fs.writeFileSync(
|
|
266
|
+
pythonBin,
|
|
267
|
+
`#!/bin/sh
|
|
268
|
+
exec /usr/bin/arch ${archFlag} "${realBin}" "$@"
|
|
269
|
+
`
|
|
270
|
+
);
|
|
271
|
+
fs.chmodSync(pythonBin, 493);
|
|
272
|
+
const pyAlt = path.join(pythonDir, "bin", "python");
|
|
273
|
+
if (fs.existsSync(pyAlt)) {
|
|
274
|
+
try {
|
|
275
|
+
fs.rmSync(pyAlt, { force: true });
|
|
276
|
+
} catch {
|
|
277
|
+
}
|
|
278
|
+
fs.writeFileSync(
|
|
279
|
+
pyAlt,
|
|
280
|
+
`#!/bin/sh
|
|
281
|
+
exec /usr/bin/arch ${archFlag} "${realBin}" "$@"
|
|
282
|
+
`
|
|
283
|
+
);
|
|
284
|
+
fs.chmodSync(pyAlt, 493);
|
|
285
|
+
}
|
|
286
|
+
logger.info("Locked python3 to host arch via shell stub", {
|
|
287
|
+
meta: { archFlag, realBin }
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
logger.info("Portable Python installed", { meta: { version: PYTHON_VERSION, pythonBin } });
|
|
292
|
+
return pythonBin;
|
|
293
|
+
}
|
|
294
|
+
async function installPythonPackages(pythonPath, packages, logger) {
|
|
295
|
+
if (packages.length === 0) return;
|
|
296
|
+
logger.info("Installing Python packages", { meta: { packages } });
|
|
297
|
+
try {
|
|
298
|
+
node_child_process.execFileSync(pythonPath, ["-m", "pip", "install", "--quiet", ...packages], {
|
|
299
|
+
stdio: "pipe",
|
|
300
|
+
timeout: 3e5
|
|
301
|
+
// 5 minutes for large packages like torch
|
|
302
|
+
});
|
|
303
|
+
logger.info("Python packages installed successfully");
|
|
304
|
+
} catch (err) {
|
|
305
|
+
logger.error("Failed to install Python packages", { meta: { error: authRecords.errMsg(err) } });
|
|
306
|
+
throw err;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
async function installPythonRequirements(pythonPath, requirementsFile, logger) {
|
|
310
|
+
if (!fs.existsSync(requirementsFile)) {
|
|
311
|
+
throw new Error(`Requirements file not found: ${requirementsFile}`);
|
|
312
|
+
}
|
|
313
|
+
const contents = fs.readFileSync(requirementsFile);
|
|
314
|
+
const hash = node_crypto.createHash("sha256").update(contents).digest("hex").slice(0, 16);
|
|
315
|
+
const fileBase = path.basename(requirementsFile).replace(/\.txt$/i, "");
|
|
316
|
+
const pythonRoot = path.join(pythonPath, "..", "..");
|
|
317
|
+
const markerDir = path.join(pythonRoot, ".requirements-installed");
|
|
318
|
+
const markerPath = path.join(markerDir, `${fileBase}-${hash}.marker`);
|
|
319
|
+
if (fs.existsSync(markerPath)) {
|
|
320
|
+
logger.debug("Python requirements already installed", { meta: { requirementsFile, hash } });
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
logger.info("Installing Python requirements", { meta: { requirementsFile, hash } });
|
|
324
|
+
try {
|
|
325
|
+
node_child_process.execFileSync(
|
|
326
|
+
pythonPath,
|
|
327
|
+
["-m", "pip", "install", "--quiet", "--disable-pip-version-check", "-r", requirementsFile],
|
|
328
|
+
{
|
|
329
|
+
stdio: "pipe",
|
|
330
|
+
timeout: 6e5
|
|
331
|
+
// 10 minutes — coremltools + tensorflow can be slow
|
|
332
|
+
}
|
|
333
|
+
);
|
|
334
|
+
} catch (err) {
|
|
335
|
+
logger.error("Failed to install Python requirements", {
|
|
336
|
+
meta: { requirementsFile, error: authRecords.errMsg(err) }
|
|
337
|
+
});
|
|
338
|
+
throw err;
|
|
339
|
+
}
|
|
340
|
+
fs.mkdirSync(markerDir, { recursive: true });
|
|
341
|
+
fs.writeFileSync(markerPath, `${requirementsFile}
|
|
342
|
+
${(/* @__PURE__ */ new Date()).toISOString()}
|
|
343
|
+
`);
|
|
344
|
+
logger.info("Python requirements installed", { meta: { requirementsFile, hash } });
|
|
345
|
+
}
|
|
346
|
+
const STORAGE_LOCATION_TYPES = [
|
|
347
|
+
"data",
|
|
348
|
+
"media",
|
|
349
|
+
"recordings",
|
|
350
|
+
"recordings-high",
|
|
351
|
+
"recordings-low",
|
|
352
|
+
"recordings-clips",
|
|
353
|
+
"event-images",
|
|
354
|
+
"models",
|
|
355
|
+
"addons-data",
|
|
356
|
+
"cache",
|
|
357
|
+
"logs",
|
|
358
|
+
"backups"
|
|
359
|
+
];
|
|
360
|
+
const DEFAULT_LOCATION_SUBDIRS = {
|
|
361
|
+
"data": "db",
|
|
362
|
+
"media": "media",
|
|
363
|
+
"recordings": "recordings",
|
|
364
|
+
"recordings-high": "recordings-high",
|
|
365
|
+
"recordings-low": "recordings-low",
|
|
366
|
+
"recordings-clips": "recordings-clips",
|
|
367
|
+
"event-images": "event-images",
|
|
368
|
+
"models": "models",
|
|
369
|
+
"addons-data": "addons-data",
|
|
370
|
+
"cache": "/tmp/camstack-cache",
|
|
371
|
+
"logs": "logs",
|
|
372
|
+
"backups": "backups"
|
|
373
|
+
};
|
|
374
|
+
class FilesystemStorageProvider {
|
|
375
|
+
id = "local";
|
|
376
|
+
name = "Local Filesystem";
|
|
377
|
+
supportedLocations = [...STORAGE_LOCATION_TYPES];
|
|
378
|
+
rootPath;
|
|
379
|
+
locationPaths;
|
|
380
|
+
constructor(rootPath, overrides) {
|
|
381
|
+
this.rootPath = path__namespace.resolve(rootPath);
|
|
382
|
+
this.locationPaths = /* @__PURE__ */ new Map();
|
|
383
|
+
for (const loc of STORAGE_LOCATION_TYPES) {
|
|
384
|
+
const override = overrides?.[loc];
|
|
385
|
+
if (override) {
|
|
386
|
+
this.locationPaths.set(loc, path__namespace.resolve(override));
|
|
387
|
+
} else {
|
|
388
|
+
const subdir = DEFAULT_LOCATION_SUBDIRS[loc];
|
|
389
|
+
this.locationPaths.set(
|
|
390
|
+
loc,
|
|
391
|
+
path__namespace.isAbsolute(subdir) ? subdir : path__namespace.join(this.rootPath, subdir)
|
|
392
|
+
);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
resolve({ location, relativePath }) {
|
|
397
|
+
const base = this.locationPaths.get(location);
|
|
398
|
+
if (!base) throw new Error(`Unknown storage location: ${location}`);
|
|
399
|
+
return path__namespace.join(base, relativePath);
|
|
400
|
+
}
|
|
401
|
+
async write({ location, relativePath, data }) {
|
|
402
|
+
const filePath = this.resolve({ location, relativePath });
|
|
403
|
+
await fs__namespace.promises.mkdir(path__namespace.dirname(filePath), { recursive: true });
|
|
404
|
+
if (Buffer.isBuffer(data)) {
|
|
405
|
+
await fs__namespace.promises.writeFile(filePath, data);
|
|
406
|
+
} else {
|
|
407
|
+
const writeStream = fs__namespace.createWriteStream(filePath);
|
|
408
|
+
await new Promise((resolve, reject) => {
|
|
409
|
+
data.pipe(writeStream);
|
|
410
|
+
writeStream.on("finish", resolve);
|
|
411
|
+
writeStream.on("error", reject);
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
async read({ location, relativePath }) {
|
|
416
|
+
return fs__namespace.promises.readFile(this.resolve({ location, relativePath }));
|
|
417
|
+
}
|
|
418
|
+
async exists({ location, relativePath }) {
|
|
419
|
+
try {
|
|
420
|
+
await fs__namespace.promises.access(this.resolve({ location, relativePath }));
|
|
421
|
+
return true;
|
|
422
|
+
} catch {
|
|
423
|
+
return false;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
async list({ location, prefix }) {
|
|
427
|
+
const base = this.locationPaths.get(location);
|
|
428
|
+
if (!base) return [];
|
|
429
|
+
const dir = prefix ? path__namespace.join(base, prefix) : base;
|
|
430
|
+
try {
|
|
431
|
+
const entries = await fs__namespace.promises.readdir(dir, { withFileTypes: true });
|
|
432
|
+
return entries.map((e) => prefix ? `${prefix}/${e.name}` : e.name);
|
|
433
|
+
} catch {
|
|
434
|
+
return [];
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
async delete({ location, relativePath }) {
|
|
438
|
+
const filePath = this.resolve({ location, relativePath });
|
|
439
|
+
await fs__namespace.promises.rm(filePath, { force: true });
|
|
440
|
+
}
|
|
441
|
+
async getAvailableSpace({ location }) {
|
|
442
|
+
const base = this.locationPaths.get(location);
|
|
443
|
+
if (!base) return null;
|
|
444
|
+
try {
|
|
445
|
+
let target = base;
|
|
446
|
+
while (!fs__namespace.existsSync(target)) {
|
|
447
|
+
const parent = path__namespace.dirname(target);
|
|
448
|
+
if (!parent || parent === target) return null;
|
|
449
|
+
target = parent;
|
|
450
|
+
}
|
|
451
|
+
const stats = await fs__namespace.promises.statfs(target);
|
|
452
|
+
return stats.bavail * stats.bsize;
|
|
453
|
+
} catch {
|
|
454
|
+
return null;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
/** Get the resolved path for a location type */
|
|
458
|
+
getLocationPath(location) {
|
|
459
|
+
const p = this.locationPaths.get(location);
|
|
460
|
+
if (!p) throw new Error(`Unknown storage location: ${location}`);
|
|
461
|
+
return p;
|
|
462
|
+
}
|
|
463
|
+
/** Get the root path */
|
|
464
|
+
getRootPath() {
|
|
465
|
+
return this.rootPath;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
exports.FilesystemStorageProvider = FilesystemStorageProvider;
|
|
469
|
+
exports.PYTHON_VERSION = PYTHON_VERSION;
|
|
470
|
+
exports.buildBinaryPath = buildBinaryPath;
|
|
471
|
+
exports.downloadBinary = downloadBinary;
|
|
472
|
+
exports.ensureBinary = ensureBinary;
|
|
473
|
+
exports.ensureFfmpeg = ensureFfmpeg;
|
|
474
|
+
exports.ensurePython = ensurePython;
|
|
475
|
+
exports.findInPath = findInPath;
|
|
476
|
+
exports.getFfmpegDownloadUrl = getFfmpegDownloadUrl;
|
|
477
|
+
exports.getPlatformInfo = getPlatformInfo;
|
|
478
|
+
exports.getPythonDownloadUrl = getPythonDownloadUrl;
|
|
479
|
+
exports.installPythonPackages = installPythonPackages;
|
|
480
|
+
exports.installPythonRequirements = installPythonRequirements;
|
|
481
|
+
//# sourceMappingURL=node.js.map
|
package/dist/node.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.js","sources":["../src/deps/binary-downloader.ts","../src/deps/ffmpeg-downloader.ts","../src/deps/python-downloader.ts","../src/storage/filesystem-storage-provider.ts"],"sourcesContent":["import { existsSync, mkdirSync, chmodSync, createWriteStream, unlinkSync } from 'node:fs'\nimport { join } from 'node:path'\nimport { pipeline } from 'node:stream/promises'\nimport { Readable } from 'node:stream'\nimport { execFileSync } from 'node:child_process'\nimport type { IScopedLogger } from '../index.js'\n\nexport interface PlatformInfo {\n readonly platform: NodeJS.Platform\n readonly arch: NodeJS.Architecture\n}\n\nexport function getPlatformInfo(): PlatformInfo {\n return {\n platform: process.platform,\n arch: process.arch,\n }\n}\n\nexport function buildBinaryPath(dataDir: string, name: string, platform?: string): string {\n const ext = (platform ?? process.platform) === 'win32' ? '.exe' : ''\n return join(dataDir, 'deps', `${name}${ext}`)\n}\n\n/** Check if a binary exists in PATH */\nexport function findInPath(name: string): string | null {\n try {\n execFileSync(name, ['--version'], { stdio: 'pipe', timeout: 5000 })\n return name\n } catch {\n return null\n }\n}\n\nexport interface DownloadOptions {\n readonly name: string\n readonly url: string\n readonly targetDir: string\n readonly targetName: string\n readonly logger: IScopedLogger\n readonly isArchive?: boolean\n readonly archiveFormat?: 'zip' | 'tar.gz' | 'tar.xz'\n /** Relative path within archive to the binary (e.g., 'ffmpeg-6.1/bin/ffmpeg') */\n readonly archiveInnerPath?: string\n}\n\n/**\n * Download a binary to the target directory.\n * Handles archives (zip, tar.gz, tar.xz) and raw binaries.\n */\nexport async function downloadBinary(opts: DownloadOptions): Promise<string> {\n const { name, url, targetDir, targetName, logger, isArchive, archiveFormat, archiveInnerPath } = opts\n const targetPath = join(targetDir, targetName)\n\n if (existsSync(targetPath)) {\n logger.debug('Binary already exists', { meta: { name, targetPath } })\n return targetPath\n }\n\n mkdirSync(targetDir, { recursive: true })\n\n logger.info('Downloading binary', { meta: { name, url } })\n const response = await fetch(url, { redirect: 'follow' })\n if (!response.ok || !response.body) {\n throw new Error(`Failed to download ${name}: ${response.status} ${response.statusText}`)\n }\n\n if (isArchive) {\n const ext = archiveFormat ?? 'tar.gz'\n const tmpArchive = join(targetDir, `${name}-download.${ext}`)\n const nodeStream = Readable.fromWeb(response.body as ReadableStream)\n await pipeline(nodeStream, createWriteStream(tmpArchive))\n\n // Extract\n const tmpExtractDir = join(targetDir, `${name}-extract`)\n mkdirSync(tmpExtractDir, { recursive: true })\n\n if (ext === 'zip') {\n try {\n execFileSync('unzip', ['-o', '-q', tmpArchive, '-d', tmpExtractDir], { stdio: 'pipe' })\n } catch {\n execFileSync('tar', ['-xf', tmpArchive, '-C', tmpExtractDir], { stdio: 'pipe' })\n }\n } else if (ext === 'tar.xz') {\n execFileSync('tar', ['-xJf', tmpArchive, '-C', tmpExtractDir], { stdio: 'pipe' })\n } else {\n execFileSync('tar', ['-xzf', tmpArchive, '-C', tmpExtractDir], { stdio: 'pipe' })\n }\n\n // Copy binary from archive\n if (archiveInnerPath) {\n const { copyFileSync } = await import('node:fs')\n const sourcePath = join(tmpExtractDir, archiveInnerPath)\n if (!existsSync(sourcePath)) {\n throw new Error(`Binary not found in archive at ${archiveInnerPath}`)\n }\n copyFileSync(sourcePath, targetPath)\n }\n\n // Cleanup\n unlinkSync(tmpArchive)\n const { rmSync } = await import('node:fs')\n rmSync(tmpExtractDir, { recursive: true, force: true })\n } else {\n // Direct binary download\n const nodeStream = Readable.fromWeb(response.body as ReadableStream)\n await pipeline(nodeStream, createWriteStream(targetPath))\n }\n\n chmodSync(targetPath, 0o755)\n logger.info('Binary downloaded', { meta: { name, targetPath } })\n return targetPath\n}\n\n/**\n * Ensure a binary is available. Checks:\n * 1. Target path (already downloaded)\n * 2. System PATH\n * 3. Download from URL\n */\nexport async function ensureBinary(opts: {\n readonly name: string\n readonly targetDir: string\n readonly downloadUrl: string\n readonly logger: IScopedLogger\n readonly isArchive?: boolean\n readonly archiveFormat?: 'zip' | 'tar.gz' | 'tar.xz'\n readonly archiveInnerPath?: string\n}): Promise<string> {\n const ext = process.platform === 'win32' ? '.exe' : ''\n const targetName = `${opts.name}${ext}`\n const targetPath = join(opts.targetDir, targetName)\n\n // 1. Already downloaded\n if (existsSync(targetPath)) {\n opts.logger.debug('Binary found at target path', { meta: { name: opts.name, targetPath } })\n return targetPath\n }\n\n // 2. System PATH\n const inPath = findInPath(opts.name)\n if (inPath) {\n opts.logger.info('Binary found in system PATH', { meta: { name: opts.name } })\n return inPath\n }\n\n // 3. Download\n return downloadBinary({\n name: opts.name,\n url: opts.downloadUrl,\n targetDir: opts.targetDir,\n targetName,\n logger: opts.logger,\n isArchive: opts.isArchive,\n archiveFormat: opts.archiveFormat,\n archiveInnerPath: opts.archiveInnerPath,\n })\n}\n","/**\n * Download ffmpeg static build for the current platform.\n *\n * Sources:\n * - Linux: https://johnvansickle.com/ffmpeg/ (static builds)\n * - macOS: https://evermeet.cx/ffmpeg/ or homebrew\n *\n * Using BtbN's GitHub releases as they cover both platforms:\n * https://github.com/BtbN/FFmpeg-Builds/releases\n */\nimport { join } from 'node:path'\nimport type { IScopedLogger } from '../index.js'\nimport { ensureBinary } from './binary-downloader.js'\n\nconst FFMPEG_VERSION = '7.1'\n\nexport function getFfmpegDownloadUrl(platform: string, arch: string): string {\n switch (platform) {\n case 'linux': {\n const archMap: Record<string, string> = { x64: 'amd64', arm64: 'arm64' }\n const a = archMap[arch]\n if (!a) throw new Error(`Unsupported Linux architecture: ${arch}`)\n // John Van Sickle static builds — well-tested, widely used\n return `https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-${a}-static.tar.xz`\n }\n case 'darwin': {\n const archMap: Record<string, string> = { arm64: 'arm64', x64: 'amd64' }\n const a = archMap[arch]\n if (!a) throw new Error(`Unsupported macOS architecture: ${arch}`)\n // macOS static builds from osxexperts (maintained, universal builds)\n return `https://www.osxexperts.net/ffmpeg${FFMPEG_VERSION.replace('.', '')}arm.zip`\n }\n default:\n throw new Error(`Unsupported platform: ${platform}`)\n }\n}\n\nexport function getFfmpegArchiveInfo(platform: string): {\n isArchive: boolean\n archiveFormat: 'zip' | 'tar.gz' | 'tar.xz'\n archiveInnerPath: string\n} {\n switch (platform) {\n case 'linux':\n return {\n isArchive: true,\n archiveFormat: 'tar.xz',\n archiveInnerPath: `ffmpeg-${FFMPEG_VERSION}-amd64-static/ffmpeg`,\n }\n case 'darwin':\n return {\n isArchive: true,\n archiveFormat: 'zip',\n archiveInnerPath: 'ffmpeg',\n }\n default:\n throw new Error(`Unsupported platform: ${platform}`)\n }\n}\n\n/**\n * Ensure ffmpeg binary is available.\n * Checks: deps dir → system PATH → download.\n */\nexport async function ensureFfmpeg(dataDir: string, logger: IScopedLogger): Promise<string> {\n const depsDir = join(dataDir, 'deps')\n const platform = process.platform\n const arch = process.arch\n\n const archiveInfo = getFfmpegArchiveInfo(platform)\n\n return ensureBinary({\n name: 'ffmpeg',\n targetDir: depsDir,\n downloadUrl: getFfmpegDownloadUrl(platform, arch),\n logger,\n ...archiveInfo,\n })\n}\n","/**\n * Download portable Python (headless) from bjia56/portable-python.\n *\n * Source: https://github.com/bjia56/portable-python\n *\n * Advantages over python-build-standalone:\n * - macOS universal2 binary (arm64+x86_64 in one)\n * - Lighter (~24-28MB headless zip)\n * - glibc 2.17 minimum (better compat)\n * - Headless variant excludes tkinter/UI (ideal for ML inference)\n *\n * The zip's top-level dir is platform-specific (e.g.\n * `python-headless-3.12.12-darwin-universal2/`); after extraction\n * we rename it to a stable `python/` so consumers can rely on\n * `<dataDir>/deps/python/bin/python3`.\n */\nimport { join, basename } from 'node:path'\nimport { existsSync, mkdirSync, chmodSync, readFileSync, writeFileSync, readdirSync, renameSync, rmSync } from 'node:fs'\nimport { execFileSync } from 'node:child_process'\nimport { createHash } from 'node:crypto'\nimport { pipeline } from 'node:stream/promises'\nimport { Readable } from 'node:stream'\nimport { createWriteStream } from 'node:fs'\nimport type { IScopedLogger } from '../index.js'\nimport { errMsg } from '../index.js'\n\nexport const PYTHON_VERSION = '3.12.12'\nconst PP_BASE = `https://github.com/bjia56/portable-python/releases/download/cpython-v${PYTHON_VERSION}-build.0`\n\nexport function getPythonDownloadUrl(platform: string, arch: string): string {\n switch (platform) {\n case 'linux': {\n const archMap: Record<string, string> = { x64: 'x86_64', arm64: 'aarch64' }\n const a = archMap[arch]\n if (!a) throw new Error(`Unsupported Linux architecture for Python: ${arch}`)\n return `${PP_BASE}/python-headless-${PYTHON_VERSION}-linux-${a}.zip`\n }\n case 'darwin': {\n // universal2 covers both arm64 and x86_64\n return `${PP_BASE}/python-headless-${PYTHON_VERSION}-darwin-universal2.zip`\n }\n default:\n throw new Error(`Unsupported platform for portable Python: ${platform}`)\n }\n}\n\n/**\n * Ensure the embedded portable Python is available.\n *\n * ALWAYS returns the path to the embedded interpreter under\n * `<dataDir>/deps/python/bin/python3` — downloads it on first call\n * and reuses it thereafter. The system PATH is intentionally NOT\n * consulted: addons rely on `installPythonRequirements()` to manage\n * deps inside the embedded site-packages, and a system interpreter\n * (different version, missing modules) silently breaks that contract.\n *\n * Returns null only if the download/extract step fails.\n */\nexport async function ensurePython(dataDir: string, logger: IScopedLogger): Promise<string | null> {\n const pythonDir = join(dataDir, 'deps', 'python')\n const pythonBin = join(pythonDir, 'bin', 'python3')\n\n // 1. Already downloaded\n if (existsSync(pythonBin)) {\n logger.debug('Portable Python found', { meta: { pythonBin } })\n return pythonBin\n }\n\n // 2. Download portable python (no system PATH fallback — by design)\n logger.info('Downloading portable Python (headless)', { meta: { version: PYTHON_VERSION } })\n\n const depsDir = join(dataDir, 'deps')\n mkdirSync(depsDir, { recursive: true })\n\n const url = getPythonDownloadUrl(process.platform, process.arch)\n const tmpArchive = join(depsDir, 'python-download.zip')\n\n logger.info('Python download source', { meta: { url } })\n\n const response = await fetch(url, { redirect: 'follow' })\n if (!response.ok || !response.body) {\n logger.warn('Failed to download Python — ML detection will not be available', { meta: { status: response.status } })\n return null\n }\n\n const nodeStream = Readable.fromWeb(response.body as ReadableStream)\n await pipeline(nodeStream, createWriteStream(tmpArchive))\n\n // Extract — zip's top-level dir is e.g. `python-headless-3.12.12-darwin-universal2/`\n // (varies per platform/arch).\n try {\n execFileSync('unzip', ['-o', '-q', tmpArchive, '-d', depsDir], { stdio: 'pipe' })\n } catch {\n // Fallback: some minimal Linux installs don't have unzip\n execFileSync('python3', ['-m', 'zipfile', '-e', tmpArchive, depsDir], { stdio: 'pipe' })\n }\n\n // Cleanup the archive\n const { unlinkSync } = await import('node:fs')\n unlinkSync(tmpArchive)\n\n // Locate the extracted directory and normalize it to `<depsDir>/python/`.\n // The zip's top-level name varies by platform (e.g.\n // `python-headless-3.12.12-darwin-universal2/`), so we look for any\n // `python-*` subdir that contains the expected `bin/python3` and rename it.\n if (!existsSync(pythonBin)) {\n const candidates = readdirSync(depsDir).filter((name) =>\n name.startsWith('python-') &&\n existsSync(join(depsDir, name, 'bin', 'python3')),\n )\n if (candidates.length === 0) {\n logger.warn('Python extraction succeeded but no python3 binary found in any subdir', {\n meta: { depsDir },\n })\n return null\n }\n const extractedRoot = join(depsDir, candidates[0]!)\n // Drop any stale `python/` (e.g. from a previous failed install)\n // before renaming so the move always succeeds.\n if (existsSync(pythonDir)) {\n rmSync(pythonDir, { recursive: true, force: true })\n }\n renameSync(extractedRoot, pythonDir)\n }\n\n if (!existsSync(pythonBin)) {\n logger.warn('Python extraction succeeded but binary not found at expected path', {\n meta: { pythonBin },\n })\n return null\n }\n\n chmodSync(pythonBin, 0o755)\n\n // On macOS the bjia56 build is universal2 — the host arch is decided\n // at spawn time based on the parent process. That makes pip wheels\n // and runtime spawns silently disagree when the server is launched\n // from a Rosetta shell once and a native shell next time (e.g. pip\n // installs `numpy x86_64`, then the next boot under arm64 fails with\n // `incompatible architecture`). Lock the slice deterministically by\n // wrapping `python3` in a shell stub that always invokes the matching\n // host arch via `/usr/bin/arch`. Idempotent: detected via the renamed\n // `.real` binary.\n if (process.platform === 'darwin') {\n const realBin = join(pythonDir, 'bin', 'python3.real')\n if (!existsSync(realBin)) {\n renameSync(pythonBin, realBin)\n const archFlag = process.arch === 'arm64' ? '-arm64' : '-x86_64'\n writeFileSync(\n pythonBin,\n `#!/bin/sh\\nexec /usr/bin/arch ${archFlag} \"${realBin}\" \"$@\"\\n`,\n )\n chmodSync(pythonBin, 0o755)\n // Mirror the same wrapping for the `python` symlink so consumers\n // that use the un-versioned name also lock the arch.\n const pyAlt = join(pythonDir, 'bin', 'python')\n if (existsSync(pyAlt)) {\n try {\n rmSync(pyAlt, { force: true })\n } catch {\n // ignore\n }\n writeFileSync(\n pyAlt,\n `#!/bin/sh\\nexec /usr/bin/arch ${archFlag} \"${realBin}\" \"$@\"\\n`,\n )\n chmodSync(pyAlt, 0o755)\n }\n logger.info('Locked python3 to host arch via shell stub', {\n meta: { archFlag, realBin },\n })\n }\n }\n\n logger.info('Portable Python installed', { meta: { version: PYTHON_VERSION, pythonBin } })\n return pythonBin\n}\n\n/**\n * Install Python packages into the portable Python environment.\n */\nexport async function installPythonPackages(\n pythonPath: string,\n packages: readonly string[],\n logger: IScopedLogger,\n): Promise<void> {\n if (packages.length === 0) return\n\n logger.info('Installing Python packages', { meta: { packages } })\n try {\n execFileSync(pythonPath, ['-m', 'pip', 'install', '--quiet', ...packages], {\n stdio: 'pipe',\n timeout: 300_000, // 5 minutes for large packages like torch\n })\n logger.info('Python packages installed successfully')\n } catch (err) {\n logger.error('Failed to install Python packages', { meta: { error: errMsg(err) } })\n throw err\n }\n}\n\n/**\n * Install a pip requirements file into the embedded Python.\n *\n * Idempotent: keyed on (requirements file basename + sha256 of its\n * contents). The marker is written under\n * `<python-install-dir>/.requirements-installed/` so it lives and\n * dies with the python install — re-downloading python wipes both\n * the site-packages and the markers, forcing a fresh re-install.\n *\n * The marker is updated only after `pip install` succeeds. A failed\n * install never writes a marker, so the next call retries.\n */\nexport async function installPythonRequirements(\n pythonPath: string,\n requirementsFile: string,\n logger: IScopedLogger,\n): Promise<void> {\n if (!existsSync(requirementsFile)) {\n throw new Error(`Requirements file not found: ${requirementsFile}`)\n }\n\n const contents = readFileSync(requirementsFile)\n const hash = createHash('sha256').update(contents).digest('hex').slice(0, 16)\n const fileBase = basename(requirementsFile).replace(/\\.txt$/i, '')\n\n // Markers live under the python install dir → wiped together when\n // the embedded interpreter is re-downloaded.\n const pythonRoot = join(pythonPath, '..', '..') // <root>/bin/python3 → <root>\n const markerDir = join(pythonRoot, '.requirements-installed')\n const markerPath = join(markerDir, `${fileBase}-${hash}.marker`)\n\n if (existsSync(markerPath)) {\n logger.debug('Python requirements already installed', { meta: { requirementsFile, hash } })\n return\n }\n\n logger.info('Installing Python requirements', { meta: { requirementsFile, hash } })\n try {\n execFileSync(\n pythonPath,\n ['-m', 'pip', 'install', '--quiet', '--disable-pip-version-check', '-r', requirementsFile],\n {\n stdio: 'pipe',\n timeout: 600_000, // 10 minutes — coremltools + tensorflow can be slow\n },\n )\n } catch (err) {\n logger.error('Failed to install Python requirements', {\n meta: { requirementsFile, error: errMsg(err) },\n })\n throw err\n }\n\n mkdirSync(markerDir, { recursive: true })\n writeFileSync(markerPath, `${requirementsFile}\\n${new Date().toISOString()}\\n`)\n logger.info('Python requirements installed', { meta: { requirementsFile, hash } })\n}\n","import * as fs from 'node:fs'\nimport * as path from 'node:path'\nimport type {\n IStorageProvider,\n StorageLocationType,\n StorageResolveInput,\n StorageWriteInput,\n StorageReadInput,\n StorageExistsInput,\n StorageListInput,\n StorageDeleteInput,\n StorageAvailableSpaceInput,\n} from '../index.js'\n\n// Inline constants to avoid runtime dependency on @camstack/types\n// (types is external in tsup bundle, may not be resolvable from data/addons/)\nconst STORAGE_LOCATION_TYPES: readonly StorageLocationType[] = [\n 'data', 'media', 'recordings',\n 'recordings-high', 'recordings-low', 'recordings-clips', 'event-images',\n 'models', 'addons-data', 'cache', 'logs', 'backups',\n]\n\nconst DEFAULT_LOCATION_SUBDIRS: Readonly<Record<StorageLocationType, string>> = {\n 'data': 'db',\n 'media': 'media',\n 'recordings': 'recordings',\n 'recordings-high': 'recordings-high',\n 'recordings-low': 'recordings-low',\n 'recordings-clips': 'recordings-clips',\n 'event-images': 'event-images',\n 'models': 'models',\n 'addons-data': 'addons-data',\n 'cache': '/tmp/camstack-cache',\n 'logs': 'logs',\n 'backups': 'backups',\n}\n\n/**\n * Filesystem storage provider — serves all location types from a local directory tree.\n *\n * Default layout:\n * {rootPath}/recordings-high/\n * {rootPath}/recordings-low/\n * {rootPath}/recordings-clips/\n * {rootPath}/event-images/\n * {rootPath}/models/\n * {rootPath}/addons-data/\n * {rootPath}/logs/\n * /tmp/camstack-cache/ (cache is always local)\n *\n * Individual location paths can be overridden.\n */\nexport class FilesystemStorageProvider implements IStorageProvider {\n readonly id = 'local'\n readonly name = 'Local Filesystem'\n readonly supportedLocations: readonly StorageLocationType[] = [...STORAGE_LOCATION_TYPES]\n\n private readonly rootPath: string\n private readonly locationPaths: Map<StorageLocationType, string>\n\n constructor(rootPath: string, overrides?: Partial<Record<StorageLocationType, string>>) {\n this.rootPath = path.resolve(rootPath)\n this.locationPaths = new Map()\n\n for (const loc of STORAGE_LOCATION_TYPES) {\n const override = overrides?.[loc]\n if (override) {\n this.locationPaths.set(loc, path.resolve(override))\n } else {\n const subdir = DEFAULT_LOCATION_SUBDIRS[loc]\n // Absolute paths (like /tmp/camstack-cache) are used as-is\n this.locationPaths.set(\n loc,\n path.isAbsolute(subdir) ? subdir : path.join(this.rootPath, subdir),\n )\n }\n }\n }\n\n resolve({ location, relativePath }: StorageResolveInput): string {\n const base = this.locationPaths.get(location)\n if (!base) throw new Error(`Unknown storage location: ${location}`)\n return path.join(base, relativePath)\n }\n\n async write({ location, relativePath, data }: StorageWriteInput): Promise<void> {\n const filePath = this.resolve({ location, relativePath })\n await fs.promises.mkdir(path.dirname(filePath), { recursive: true })\n\n if (Buffer.isBuffer(data)) {\n await fs.promises.writeFile(filePath, data)\n } else {\n // Stream\n const writeStream = fs.createWriteStream(filePath)\n await new Promise<void>((resolve, reject) => {\n (data as NodeJS.ReadableStream).pipe(writeStream)\n writeStream.on('finish', resolve)\n writeStream.on('error', reject)\n })\n }\n }\n\n async read({ location, relativePath }: StorageReadInput): Promise<Buffer> {\n return fs.promises.readFile(this.resolve({ location, relativePath }))\n }\n\n async exists({ location, relativePath }: StorageExistsInput): Promise<boolean> {\n try {\n await fs.promises.access(this.resolve({ location, relativePath }))\n return true\n } catch {\n return false\n }\n }\n\n async list({ location, prefix }: StorageListInput): Promise<readonly string[]> {\n const base = this.locationPaths.get(location)\n if (!base) return []\n const dir = prefix ? path.join(base, prefix) : base\n try {\n const entries = await fs.promises.readdir(dir, { withFileTypes: true })\n return entries.map(e => (prefix ? `${prefix}/${e.name}` : e.name))\n } catch {\n return []\n }\n }\n\n async delete({ location, relativePath }: StorageDeleteInput): Promise<void> {\n const filePath = this.resolve({ location, relativePath })\n await fs.promises.rm(filePath, { force: true })\n }\n\n async getAvailableSpace({ location }: StorageAvailableSpaceInput): Promise<number | null> {\n const base = this.locationPaths.get(location)\n if (!base) return null\n // If the directory doesn't exist yet (lazy creation), walk up to\n // the nearest existing ancestor so statfs can still report free\n // space on the mount point. This keeps the storage dashboard\n // working on a fresh install where no file has been written yet.\n try {\n let target = base\n while (!fs.existsSync(target)) {\n const parent = path.dirname(target)\n if (!parent || parent === target) return null\n target = parent\n }\n const stats = await fs.promises.statfs(target)\n return stats.bavail * stats.bsize\n } catch {\n return null\n }\n }\n\n\n /** Get the resolved path for a location type */\n getLocationPath(location: StorageLocationType): string {\n const p = this.locationPaths.get(location)\n if (!p) throw new Error(`Unknown storage location: ${location}`)\n return p\n }\n\n /** Get the root path */\n getRootPath(): string {\n return this.rootPath\n }\n}\n\nexport default FilesystemStorageProvider\n"],"names":["join","execFileSync","existsSync","mkdirSync","Readable","pipeline","createWriteStream","unlinkSync","chmodSync","readdirSync","rmSync","renameSync","writeFileSync","errMsg","readFileSync","createHash","basename","path","fs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYO,SAAS,kBAAgC;AAC9C,SAAO;AAAA,IACL,UAAU,QAAQ;AAAA,IAClB,MAAM,QAAQ;AAAA,EAAA;AAElB;AAEO,SAAS,gBAAgB,SAAiB,MAAc,UAA2B;AACxF,QAAM,OAAO,YAAY,QAAQ,cAAc,UAAU,SAAS;AAClE,SAAOA,KAAAA,KAAK,SAAS,QAAQ,GAAG,IAAI,GAAG,GAAG,EAAE;AAC9C;AAGO,SAAS,WAAW,MAA6B;AACtD,MAAI;AACFC,oCAAa,MAAM,CAAC,WAAW,GAAG,EAAE,OAAO,QAAQ,SAAS,KAAM;AAClE,WAAO;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAkBA,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