@camstack/core 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/addon-api-factory.d.ts +36 -0
- package/dist/addon/addon-api-factory.d.ts.map +1 -0
- package/dist/addon-routes/addon-route-registry.d.ts +38 -0
- package/dist/addon-routes/addon-route-registry.d.ts.map +1 -0
- package/dist/auth/api-key-manager.d.ts +27 -0
- package/dist/auth/api-key-manager.d.ts.map +1 -0
- package/dist/auth/auth-manager.d.ts +47 -0
- package/dist/auth/auth-manager.d.ts.map +1 -0
- package/dist/auth/parse-record.d.ts +19 -0
- package/dist/auth/parse-record.d.ts.map +1 -0
- package/dist/auth/scoped-token-manager.d.ts +18 -0
- package/dist/auth/scoped-token-manager.d.ts.map +1 -0
- package/dist/auth/user-manager.d.ts +34 -0
- package/dist/auth/user-manager.d.ts.map +1 -0
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.d.ts +54 -0
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.d.ts.map +1 -0
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +226 -0
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js.map +1 -0
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +218 -0
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs.map +1 -0
- package/dist/builtins/addon-pages-aggregator/index.d.ts +2 -0
- package/dist/builtins/addon-pages-aggregator/index.d.ts.map +1 -0
- package/dist/builtins/addon-pages-aggregator/index.js +7 -0
- package/dist/builtins/addon-pages-aggregator/index.mjs +2 -0
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.d.ts +33 -0
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.d.ts.map +1 -0
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +202 -0
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js.map +1 -0
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +194 -0
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs.map +1 -0
- package/dist/builtins/addon-widgets-aggregator/index.d.ts +2 -0
- package/dist/builtins/addon-widgets-aggregator/index.d.ts.map +1 -0
- package/dist/builtins/addon-widgets-aggregator/index.js +7 -0
- package/dist/builtins/addon-widgets-aggregator/index.mjs +2 -0
- package/dist/builtins/alerts/alerts.addon.d.ts +82 -0
- package/dist/builtins/alerts/alerts.addon.d.ts.map +1 -0
- package/dist/builtins/alerts/alerts.addon.js +603 -0
- package/dist/builtins/alerts/alerts.addon.js.map +1 -0
- package/dist/builtins/alerts/alerts.addon.mjs +597 -0
- package/dist/builtins/alerts/alerts.addon.mjs.map +1 -0
- package/dist/builtins/alerts/index.d.ts +2 -0
- package/dist/builtins/alerts/index.d.ts.map +1 -0
- package/dist/builtins/alerts/index.js +3 -0
- package/dist/builtins/alerts/index.mjs +2 -0
- package/dist/builtins/auth-orchestrator/auth-orchestrator.addon.d.ts +8 -0
- package/dist/builtins/auth-orchestrator/auth-orchestrator.addon.d.ts.map +1 -0
- package/dist/builtins/auth-orchestrator/auth-orchestrator.addon.js +56 -0
- package/dist/builtins/auth-orchestrator/auth-orchestrator.addon.js.map +1 -0
- package/dist/builtins/auth-orchestrator/auth-orchestrator.addon.mjs +50 -0
- package/dist/builtins/auth-orchestrator/auth-orchestrator.addon.mjs.map +1 -0
- package/dist/builtins/auth-orchestrator/index.d.ts +2 -0
- package/dist/builtins/auth-orchestrator/index.d.ts.map +1 -0
- package/dist/builtins/auth-orchestrator/index.js +7 -0
- package/dist/builtins/auth-orchestrator/index.mjs +2 -0
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.d.ts +148 -0
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.d.ts.map +1 -0
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +7639 -0
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js.map +1 -0
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +7627 -0
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs.map +1 -0
- package/dist/builtins/backup-orchestrator/cron-helpers.d.ts +24 -0
- package/dist/builtins/backup-orchestrator/cron-helpers.d.ts.map +1 -0
- package/dist/builtins/backup-orchestrator/destination-policy.d.ts +73 -0
- package/dist/builtins/backup-orchestrator/destination-policy.d.ts.map +1 -0
- package/dist/builtins/backup-orchestrator/download-helpers.d.ts +13 -0
- package/dist/builtins/backup-orchestrator/download-helpers.d.ts.map +1 -0
- package/dist/builtins/backup-orchestrator/index.d.ts +3 -0
- package/dist/builtins/backup-orchestrator/index.d.ts.map +1 -0
- package/dist/builtins/backup-orchestrator/index.js +7 -0
- package/dist/builtins/backup-orchestrator/index.mjs +2 -0
- package/dist/builtins/backup-orchestrator/manifest-store.d.ts +78 -0
- package/dist/builtins/backup-orchestrator/manifest-store.d.ts.map +1 -0
- package/dist/builtins/console-logging/console-destination.d.ts +14 -0
- package/dist/builtins/console-logging/console-destination.d.ts.map +1 -0
- package/dist/builtins/console-logging/console-logging.addon.d.ts +26 -0
- package/dist/builtins/console-logging/console-logging.addon.d.ts.map +1 -0
- package/dist/builtins/console-logging/index.d.ts +4 -0
- package/dist/builtins/console-logging/index.d.ts.map +1 -0
- package/dist/builtins/console-logging/index.js +106 -0
- package/dist/builtins/console-logging/index.js.map +1 -0
- package/dist/builtins/console-logging/index.mjs +97 -0
- package/dist/builtins/console-logging/index.mjs.map +1 -0
- package/dist/builtins/device-manager/device-event-propagator.d.ts +27 -0
- package/dist/builtins/device-manager/device-event-propagator.d.ts.map +1 -0
- package/dist/builtins/device-manager/device-manager.addon.d.ts +259 -0
- package/dist/builtins/device-manager/device-manager.addon.d.ts.map +1 -0
- package/dist/builtins/device-manager/device-manager.addon.js +2153 -0
- package/dist/builtins/device-manager/device-manager.addon.js.map +1 -0
- package/dist/builtins/device-manager/device-manager.addon.mjs +2147 -0
- package/dist/builtins/device-manager/device-manager.addon.mjs.map +1 -0
- package/dist/builtins/device-manager/index.d.ts +3 -0
- package/dist/builtins/device-manager/index.d.ts.map +1 -0
- package/dist/builtins/device-manager/index.js +7 -0
- package/dist/builtins/device-manager/index.mjs +2 -0
- package/dist/builtins/hub-forwarder/hub-forwarder-destination.d.ts +45 -0
- package/dist/builtins/hub-forwarder/hub-forwarder-destination.d.ts.map +1 -0
- package/dist/builtins/hub-forwarder/hub-forwarder.addon.d.ts +16 -0
- package/dist/builtins/hub-forwarder/hub-forwarder.addon.d.ts.map +1 -0
- package/dist/builtins/hub-forwarder/index.d.ts +4 -0
- package/dist/builtins/hub-forwarder/index.d.ts.map +1 -0
- package/dist/builtins/hub-forwarder/index.js +156 -0
- package/dist/builtins/hub-forwarder/index.js.map +1 -0
- package/dist/builtins/hub-forwarder/index.mjs +147 -0
- package/dist/builtins/hub-forwarder/index.mjs.map +1 -0
- package/dist/builtins/local-auth/auth-schema.d.ts +12 -0
- package/dist/builtins/local-auth/auth-schema.d.ts.map +1 -0
- package/dist/builtins/local-auth/index.d.ts +2 -0
- package/dist/builtins/local-auth/index.d.ts.map +1 -0
- package/dist/builtins/local-auth/index.js +3 -0
- package/dist/builtins/local-auth/index.mjs +2 -0
- package/dist/builtins/local-auth/local-auth.addon.d.ts +17 -0
- package/dist/builtins/local-auth/local-auth.addon.d.ts.map +1 -0
- package/dist/builtins/local-auth/local-auth.addon.js +6895 -0
- package/dist/builtins/local-auth/local-auth.addon.js.map +1 -0
- package/dist/builtins/local-auth/local-auth.addon.mjs +6885 -0
- package/dist/builtins/local-auth/local-auth.addon.mjs.map +1 -0
- package/dist/builtins/local-network/index.d.ts +3 -0
- package/dist/builtins/local-network/index.d.ts.map +1 -0
- package/dist/builtins/local-network/index.js +9 -0
- package/dist/builtins/local-network/index.mjs +2 -0
- package/dist/builtins/local-network/local-network.addon.d.ts +102 -0
- package/dist/builtins/local-network/local-network.addon.d.ts.map +1 -0
- package/dist/builtins/local-network/local-network.addon.js +404 -0
- package/dist/builtins/local-network/local-network.addon.js.map +1 -0
- package/dist/builtins/local-network/local-network.addon.mjs +392 -0
- package/dist/builtins/local-network/local-network.addon.mjs.map +1 -0
- package/dist/builtins/mesh-orchestrator/index.d.ts +2 -0
- package/dist/builtins/mesh-orchestrator/index.d.ts.map +1 -0
- package/dist/builtins/mesh-orchestrator/index.js +7 -0
- package/dist/builtins/mesh-orchestrator/index.mjs +2 -0
- package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.d.ts +9 -0
- package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.d.ts.map +1 -0
- package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.js +83 -0
- package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.js.map +1 -0
- package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.mjs +77 -0
- package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.mjs.map +1 -0
- package/dist/builtins/native-metrics/index.d.ts +3 -0
- package/dist/builtins/native-metrics/index.d.ts.map +1 -0
- package/dist/builtins/native-metrics/native-metrics-provider.d.ts +49 -0
- package/dist/builtins/native-metrics/native-metrics-provider.d.ts.map +1 -0
- package/dist/builtins/native-metrics/native-metrics.addon.d.ts +74 -0
- package/dist/builtins/native-metrics/native-metrics.addon.d.ts.map +1 -0
- package/dist/builtins/native-metrics/native-metrics.addon.js +924 -0
- package/dist/builtins/native-metrics/native-metrics.addon.js.map +1 -0
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +916 -0
- package/dist/builtins/native-metrics/native-metrics.addon.mjs.map +1 -0
- package/dist/builtins/platform-probe/index.d.ts +12 -0
- package/dist/builtins/platform-probe/index.d.ts.map +1 -0
- package/dist/builtins/platform-probe/index.js +539 -0
- package/dist/builtins/platform-probe/index.js.map +1 -0
- package/dist/builtins/platform-probe/index.mjs +530 -0
- package/dist/builtins/platform-probe/index.mjs.map +1 -0
- package/dist/builtins/platform-probe/inference-config-resolver.d.ts +30 -0
- package/dist/builtins/platform-probe/inference-config-resolver.d.ts.map +1 -0
- package/dist/builtins/platform-probe/platform-scorer.d.ts +22 -0
- package/dist/builtins/platform-probe/platform-scorer.d.ts.map +1 -0
- package/dist/builtins/remote-access-orchestrator/index.d.ts +2 -0
- package/dist/builtins/remote-access-orchestrator/index.d.ts.map +1 -0
- package/dist/builtins/remote-access-orchestrator/index.js +7 -0
- package/dist/builtins/remote-access-orchestrator/index.mjs +2 -0
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.d.ts +9 -0
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.d.ts.map +1 -0
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +72 -0
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js.map +1 -0
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +66 -0
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs.map +1 -0
- package/dist/builtins/snapshot/index.d.ts +3 -0
- package/dist/builtins/snapshot/index.d.ts.map +1 -0
- package/dist/builtins/snapshot/index.js +494 -0
- package/dist/builtins/snapshot/index.js.map +1 -0
- package/dist/builtins/snapshot/index.mjs +488 -0
- package/dist/builtins/snapshot/index.mjs.map +1 -0
- package/dist/builtins/snapshot/snapshot.addon.d.ts +121 -0
- package/dist/builtins/snapshot/snapshot.addon.d.ts.map +1 -0
- package/dist/builtins/sqlite-storage/config-store.d.ts +9 -0
- package/dist/builtins/sqlite-storage/config-store.d.ts.map +1 -0
- package/dist/builtins/sqlite-storage/device-store.d.ts +24 -0
- package/dist/builtins/sqlite-storage/device-store.d.ts.map +1 -0
- package/dist/builtins/sqlite-storage/filesystem-storage-provider.d.ts +87 -0
- package/dist/builtins/sqlite-storage/filesystem-storage-provider.d.ts.map +1 -0
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.d.ts +32 -2
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.d.ts.map +1 -0
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +311 -205
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js.map +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +305 -7
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs.map +1 -1
- package/dist/builtins/sqlite-storage/index.d.ts +12 -4
- package/dist/builtins/sqlite-storage/index.d.ts.map +1 -0
- package/dist/builtins/sqlite-storage/index.js +258 -1097
- package/dist/builtins/sqlite-storage/index.js.map +1 -1
- package/dist/builtins/sqlite-storage/index.mjs +268 -28
- package/dist/builtins/sqlite-storage/index.mjs.map +1 -1
- package/dist/builtins/sqlite-storage/integration-registry.d.ts +28 -0
- package/dist/builtins/sqlite-storage/integration-registry.d.ts.map +1 -0
- package/dist/builtins/sqlite-storage/settings-store.d.ts +40 -0
- package/dist/builtins/sqlite-storage/settings-store.d.ts.map +1 -0
- package/dist/builtins/sqlite-storage/sql-schema.d.ts +33 -0
- package/dist/builtins/sqlite-storage/sql-schema.d.ts.map +1 -0
- package/dist/builtins/sqlite-storage/sqlite-settings-backend.d.ts +94 -0
- package/dist/builtins/sqlite-storage/sqlite-settings-backend.d.ts.map +1 -0
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.d.ts +15 -2
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.d.ts.map +1 -0
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +588 -417
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js.map +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +582 -7
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs.map +1 -1
- package/dist/builtins/storage-orchestrator/index.d.ts +7 -0
- package/dist/builtins/storage-orchestrator/index.d.ts.map +1 -0
- package/dist/builtins/storage-orchestrator/index.js +9 -0
- package/dist/builtins/storage-orchestrator/index.mjs +2 -0
- package/dist/builtins/storage-orchestrator/location-store.d.ts +50 -0
- package/dist/builtins/storage-orchestrator/location-store.d.ts.map +1 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.d.ts +60 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.d.ts.map +1 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +755 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js.map +1 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +746 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs.map +1 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.service.d.ts +121 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.service.d.ts.map +1 -0
- package/dist/builtins/system-backup/system-backup.service.d.ts +138 -0
- package/dist/builtins/system-backup/system-backup.service.d.ts.map +1 -0
- package/dist/builtins/system-config/index.d.ts +2 -0
- package/dist/builtins/system-config/index.d.ts.map +1 -0
- package/dist/builtins/system-config/index.js +7 -0
- package/dist/builtins/system-config/index.mjs +2 -0
- package/dist/builtins/system-config/system-config.addon.d.ts +11 -0
- package/dist/builtins/system-config/system-config.addon.d.ts.map +1 -0
- package/dist/builtins/system-config/system-config.addon.js +234 -0
- package/dist/builtins/system-config/system-config.addon.js.map +1 -0
- package/dist/builtins/system-config/system-config.addon.mjs +228 -0
- package/dist/builtins/system-config/system-config.addon.mjs.map +1 -0
- package/dist/builtins/turn-orchestrator/index.d.ts +2 -0
- package/dist/builtins/turn-orchestrator/index.d.ts.map +1 -0
- package/dist/builtins/turn-orchestrator/index.js +7 -0
- package/dist/builtins/turn-orchestrator/index.mjs +2 -0
- package/dist/builtins/turn-orchestrator/turn-orchestrator.addon.d.ts +10 -0
- package/dist/builtins/turn-orchestrator/turn-orchestrator.addon.d.ts.map +1 -0
- package/dist/builtins/turn-orchestrator/turn-orchestrator.addon.js +78 -0
- package/dist/builtins/turn-orchestrator/turn-orchestrator.addon.js.map +1 -0
- package/dist/builtins/turn-orchestrator/turn-orchestrator.addon.mjs +72 -0
- package/dist/builtins/turn-orchestrator/turn-orchestrator.addon.mjs.map +1 -0
- package/dist/builtins/winston-logging/index.d.ts +4 -30
- package/dist/builtins/winston-logging/index.d.ts.map +1 -0
- package/dist/builtins/winston-logging/index.js +153 -180
- package/dist/builtins/winston-logging/index.js.map +1 -1
- package/dist/builtins/winston-logging/index.mjs +144 -8
- package/dist/builtins/winston-logging/index.mjs.map +1 -1
- package/dist/builtins/winston-logging/winston-destination.d.ts +22 -0
- package/dist/builtins/winston-logging/winston-destination.d.ts.map +1 -0
- package/dist/builtins/winston-logging/winston-logging.addon.d.ts +20 -0
- package/dist/builtins/winston-logging/winston-logging.addon.d.ts.map +1 -0
- package/dist/chunk-C13QxCFV.js +50 -0
- package/dist/chunk-hT5z_Zn9.mjs +35 -0
- package/dist/download/model-download-service.d.ts +42 -0
- package/dist/download/model-download-service.d.ts.map +1 -0
- package/dist/download/model-downloader.d.ts +32 -0
- package/dist/download/model-downloader.d.ts.map +1 -0
- package/dist/events/event-bus.d.ts +11 -0
- package/dist/events/event-bus.d.ts.map +1 -0
- package/dist/events/system-event-bus.d.ts +15 -0
- package/dist/events/system-event-bus.d.ts.map +1 -0
- package/dist/feature/feature-manager.d.ts +12 -0
- package/dist/feature/feature-manager.d.ts.map +1 -0
- package/dist/formatter-C-5An4Bl.mjs +164 -0
- package/dist/formatter-C-5An4Bl.mjs.map +1 -0
- package/dist/formatter-Dr_6NNZc.js +169 -0
- package/dist/formatter-Dr_6NNZc.js.map +1 -0
- package/dist/index.d.ts +76 -1137
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7761 -7017
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7699 -3798
- package/dist/index.mjs.map +1 -1
- package/dist/lifecycle/lifecycle-state-machine.d.ts +29 -0
- package/dist/lifecycle/lifecycle-state-machine.d.ts.map +1 -0
- package/dist/logging/formatter.d.ts +31 -0
- package/dist/logging/formatter.d.ts.map +1 -0
- package/dist/logging/log-manager.d.ts +52 -0
- package/dist/logging/log-manager.d.ts.map +1 -0
- package/dist/logging/log-ring-buffer.d.ts +48 -0
- package/dist/logging/log-ring-buffer.d.ts.map +1 -0
- package/dist/logging/scoped-logger.d.ts +18 -0
- package/dist/logging/scoped-logger.d.ts.map +1 -0
- package/dist/network/network-quality.d.ts +12 -0
- package/dist/network/network-quality.d.ts.map +1 -0
- package/dist/notification/notification-service.d.ts +38 -0
- package/dist/notification/notification-service.d.ts.map +1 -0
- package/dist/notification/toast-service.d.ts +23 -0
- package/dist/notification/toast-service.d.ts.map +1 -0
- package/dist/pipeline/engine-manager-resolver.d.ts +16 -0
- package/dist/pipeline/engine-manager-resolver.d.ts.map +1 -0
- package/dist/pipeline/pipeline-runner.d.ts +9 -0
- package/dist/pipeline/pipeline-runner.d.ts.map +1 -0
- package/dist/pipeline/pipeline-validator.d.ts +14 -0
- package/dist/pipeline/pipeline-validator.d.ts.map +1 -0
- package/dist/process/resource-monitor.d.ts +12 -0
- package/dist/process/resource-monitor.d.ts.map +1 -0
- package/dist/python/python-env-manager.d.ts +13 -0
- package/dist/python/python-env-manager.d.ts.map +1 -0
- package/dist/repl/interfaces.d.ts +32 -0
- package/dist/repl/interfaces.d.ts.map +1 -0
- package/dist/repl/repl-engine.d.ts +9 -0
- package/dist/repl/repl-engine.d.ts.map +1 -0
- package/dist/resource-monitor-CmuWlmap.js +76 -0
- package/dist/resource-monitor-CmuWlmap.js.map +1 -0
- package/dist/resource-monitor-DcQdKGYU.mjs +59 -0
- package/dist/resource-monitor-DcQdKGYU.mjs.map +1 -0
- package/dist/storage/fs-storage-backend.d.ts +41 -0
- package/dist/storage/fs-storage-backend.d.ts.map +1 -0
- package/dist/storage/storage-location-manager.d.ts +24 -0
- package/dist/storage/storage-location-manager.d.ts.map +1 -0
- package/dist/storage/storage-manager.d.ts +77 -0
- package/dist/storage/storage-manager.d.ts.map +1 -0
- package/dist/tls/cert-manager.d.ts +27 -0
- package/dist/tls/cert-manager.d.ts.map +1 -0
- package/dist/tls/index.d.ts +2 -0
- package/dist/tls/index.d.ts.map +1 -0
- package/package.json +230 -13
- package/dist/builtins/local-backup/index.d.mts +0 -42
- package/dist/builtins/local-backup/index.d.ts +0 -42
- package/dist/builtins/local-backup/index.js +0 -188
- package/dist/builtins/local-backup/index.js.map +0 -1
- package/dist/builtins/local-backup/index.mjs +0 -10
- package/dist/builtins/local-backup/index.mjs.map +0 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.d.mts +0 -2
- package/dist/builtins/sqlite-storage/index.d.mts +0 -4
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.d.mts +0 -2
- package/dist/builtins/winston-logging/index.d.mts +0 -30
- package/dist/chunk-2F3XZYRW.mjs +0 -89
- package/dist/chunk-2F3XZYRW.mjs.map +0 -1
- package/dist/chunk-LQFPAEQF.mjs +0 -147
- package/dist/chunk-LQFPAEQF.mjs.map +0 -1
- package/dist/chunk-R3DIIBBX.mjs +0 -532
- package/dist/chunk-R3DIIBBX.mjs.map +0 -1
- package/dist/chunk-SMNR44VG.mjs +0 -386
- package/dist/chunk-SMNR44VG.mjs.map +0 -1
- package/dist/chunk-SO4LROOT.mjs +0 -150
- package/dist/chunk-SO4LROOT.mjs.map +0 -1
- package/dist/chunk-SPA4JBKN.mjs +0 -175
- package/dist/chunk-SPA4JBKN.mjs.map +0 -1
- package/dist/dist-3BY63UQ5.mjs +0 -2151
- package/dist/dist-3BY63UQ5.mjs.map +0 -1
- package/dist/filesystem-storage.addon-C42r589X.d.mts +0 -57
- package/dist/filesystem-storage.addon-C42r589X.d.ts +0 -57
- package/dist/index.d.mts +0 -1137
- package/dist/sql-schema-CKz78rId.d.mts +0 -97
- package/dist/sql-schema-CKz78rId.d.ts +0 -97
- package/dist/sqlite-settings.addon-KwG-uKMP.d.mts +0 -79
- package/dist/sqlite-settings.addon-KwG-uKMP.d.ts +0 -79
- package/dist/storage-location-manager-KKDQNAKA.mjs +0 -7
- package/dist/storage-location-manager-KKDQNAKA.mjs.map +0 -1
package/dist/index.d.mts
DELETED
|
@@ -1,1137 +0,0 @@
|
|
|
1
|
-
import { IScopedLogger, ModelDownloadOptions, ModelDownloadResult, IAddonModelManager, ModelCatalogEntry, ModelFormat, IPythonEnvironment, PythonProbeResult, PythonEnvReady, PipelineConfig, ValidationResult, FrameInput, PipelineResult, AudioChunkInput, PipelineNode, ElementState as ElementState$1, LoggerFactory, ProcessConfig, ManagedProcessStatus, INetworkQualityTracker, ClientNetworkStats, DeviceNetworkStats, ReplResult, AgentInfo, AgentEntry, AgentStatus, AgentTask, TaskDispatchOptions, AgentTaskResult, LogEntry, LogFilter, AgentRegistrationInfo, AgentToHubMessage, HubToAgentMessage, AgentRuntimeStatus, ITaskHandler, TaskContext, IEventBus, FeatureManifest, FeatureFlag, SystemEvent, EventFilter, IStorageProvider as IStorageProvider$1, ISettingsBackend, TokenScope, ScopedToken, TokenPayload, UserRole, UserRecord, INotificationOutput, Notification, Toast, IAddonRouteProvider, IAddonHttpRoute, PlatformCapabilities, HardwareInfo, PlatformScore, ModelRequirement, ResolvedInferenceConfig, IIntegrationRegistry, CreateIntegrationInput, Integration, CreateDeviceInput, Device, ProviderListItem } from '@camstack/types';
|
|
2
|
-
export { AgentEntry, AgentInfo, AgentResources, AgentStatus, AgentTask, AgentTaskResult, BackupManifest, ClientNetworkStats, DeviceNetworkStats, EventFilter, EventSource, FeatureFlag, FeatureManifest, INetworkQualityTracker, IScopedLogger, LogEntry, LogFilter, LogLevel, ManagedProcessStatus, ProcessConfig, ProcessStats, ProviderListItem, ReplResult, StreamNetworkStats, SystemEvent, TaskDispatchOptions, TokenPayload, UserRecord, UserRole, ValidationIssue, ValidationResult } from '@camstack/types';
|
|
3
|
-
import { ChildProcess } from 'node:child_process';
|
|
4
|
-
import { AddonLoader, AddonEngineManager, CapabilityRegistry } from '@camstack/kernel';
|
|
5
|
-
export { A as AddonTableSchema, C as CORE_TABLE_DDL, F as FileSystemStorage, S as SettingsStore, a as SqliteStorageAddon, b as SqliteStorageProvider, c as addonTableToDdl } from './sql-schema-CKz78rId.mjs';
|
|
6
|
-
export { WinstonDestination, WinstonLoggingAddon } from './builtins/winston-logging/index.mjs';
|
|
7
|
-
export { BackupConfig, LocalBackupAddon, LocalBackupService } from './builtins/local-backup/index.mjs';
|
|
8
|
-
|
|
9
|
-
interface PlatformInfo {
|
|
10
|
-
readonly platform: NodeJS.Platform;
|
|
11
|
-
readonly arch: NodeJS.Architecture;
|
|
12
|
-
}
|
|
13
|
-
declare function getPlatformInfo(): PlatformInfo;
|
|
14
|
-
declare function buildBinaryPath(dataDir: string, name: string, platform?: string): string;
|
|
15
|
-
/** Check if a binary exists in PATH */
|
|
16
|
-
declare function findInPath(name: string): string | null;
|
|
17
|
-
interface DownloadOptions {
|
|
18
|
-
readonly name: string;
|
|
19
|
-
readonly url: string;
|
|
20
|
-
readonly targetDir: string;
|
|
21
|
-
readonly targetName: string;
|
|
22
|
-
readonly logger: IScopedLogger;
|
|
23
|
-
readonly isArchive?: boolean;
|
|
24
|
-
readonly archiveFormat?: 'zip' | 'tar.gz' | 'tar.xz';
|
|
25
|
-
/** Relative path within archive to the binary (e.g., 'ffmpeg-6.1/bin/ffmpeg') */
|
|
26
|
-
readonly archiveInnerPath?: string;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Download a binary to the target directory.
|
|
30
|
-
* Handles archives (zip, tar.gz, tar.xz) and raw binaries.
|
|
31
|
-
*/
|
|
32
|
-
declare function downloadBinary(opts: DownloadOptions): Promise<string>;
|
|
33
|
-
/**
|
|
34
|
-
* Ensure a binary is available. Checks:
|
|
35
|
-
* 1. Target path (already downloaded)
|
|
36
|
-
* 2. System PATH
|
|
37
|
-
* 3. Download from URL
|
|
38
|
-
*/
|
|
39
|
-
declare function ensureBinary(opts: {
|
|
40
|
-
readonly name: string;
|
|
41
|
-
readonly targetDir: string;
|
|
42
|
-
readonly downloadUrl: string;
|
|
43
|
-
readonly logger: IScopedLogger;
|
|
44
|
-
readonly isArchive?: boolean;
|
|
45
|
-
readonly archiveFormat?: 'zip' | 'tar.gz' | 'tar.xz';
|
|
46
|
-
readonly archiveInnerPath?: string;
|
|
47
|
-
}): Promise<string>;
|
|
48
|
-
|
|
49
|
-
declare function getFfmpegDownloadUrl(platform: string, arch: string): string;
|
|
50
|
-
/**
|
|
51
|
-
* Ensure ffmpeg binary is available.
|
|
52
|
-
* Checks: deps dir → system PATH → download.
|
|
53
|
-
*/
|
|
54
|
-
declare function ensureFfmpeg(dataDir: string, logger: IScopedLogger): Promise<string>;
|
|
55
|
-
|
|
56
|
-
declare const PYTHON_VERSION = "3.12.12";
|
|
57
|
-
declare function getPythonDownloadUrl(platform: string, arch: string): string;
|
|
58
|
-
/**
|
|
59
|
-
* Ensure a portable Python is available.
|
|
60
|
-
* Checks: embedded python → system PATH → download portable.
|
|
61
|
-
*
|
|
62
|
-
* Returns the path to the python3 binary.
|
|
63
|
-
*/
|
|
64
|
-
declare function ensurePython(dataDir: string, logger: IScopedLogger): Promise<string | null>;
|
|
65
|
-
/**
|
|
66
|
-
* Install Python packages into the portable Python environment.
|
|
67
|
-
*/
|
|
68
|
-
declare function installPythonPackages(pythonPath: string, packages: readonly string[], logger: IScopedLogger): Promise<void>;
|
|
69
|
-
|
|
70
|
-
type EventCallback<T = unknown> = (data: T) => void;
|
|
71
|
-
declare class EventBus {
|
|
72
|
-
private listeners;
|
|
73
|
-
on<T = unknown>(event: string, callback: EventCallback<T>): () => void;
|
|
74
|
-
emit<T = unknown>(event: string, data: T): void;
|
|
75
|
-
once<T = unknown>(event: string, callback: EventCallback<T>): () => void;
|
|
76
|
-
removeAllListeners(event?: string): void;
|
|
77
|
-
listenerCount(event: string): number;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Download a single file from a URL to a destination path.
|
|
82
|
-
* Uses native fetch() (Node 22+) which handles redirects natively.
|
|
83
|
-
* Streams to disk with optional progress callback.
|
|
84
|
-
* Returns the destination path. Skips download if file already exists.
|
|
85
|
-
*/
|
|
86
|
-
declare function downloadFile(url: string, destPath: string, onProgress?: (downloaded: number, total: number) => void): Promise<string>;
|
|
87
|
-
/**
|
|
88
|
-
* Fetch JSON from a URL using native fetch().
|
|
89
|
-
*/
|
|
90
|
-
declare function fetchJson(url: string): Promise<unknown>;
|
|
91
|
-
/**
|
|
92
|
-
* Download a model with fallback URLs and optional SHA256 verification.
|
|
93
|
-
* Legacy API preserved for backward compatibility -- delegates to downloadFile().
|
|
94
|
-
*/
|
|
95
|
-
declare function downloadModel(options: ModelDownloadOptions): Promise<ModelDownloadResult>;
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Unified model download service.
|
|
99
|
-
*
|
|
100
|
-
* Handles downloading model files and extra files (labels, dicts) from a
|
|
101
|
-
* catalog of ModelCatalogEntry items. Supports single-file models and
|
|
102
|
-
* directory bundles (e.g., .mlpackage for CoreML).
|
|
103
|
-
*
|
|
104
|
-
* Addons use this via `context.models.ensure(modelId, format)`.
|
|
105
|
-
*/
|
|
106
|
-
declare class ModelDownloadService implements IAddonModelManager {
|
|
107
|
-
private readonly modelsDir;
|
|
108
|
-
private readonly onProgress?;
|
|
109
|
-
private readonly catalog;
|
|
110
|
-
constructor(modelsDir: string, catalog: readonly ModelCatalogEntry[], onProgress?: ((modelId: string, downloaded: number, total: number) => void) | undefined);
|
|
111
|
-
/**
|
|
112
|
-
* Ensure a model (and its extra files) is downloaded.
|
|
113
|
-
* Returns the local filesystem path to the model file/directory.
|
|
114
|
-
*/
|
|
115
|
-
ensure(modelId: string, format?: ModelFormat): Promise<string>;
|
|
116
|
-
/**
|
|
117
|
-
* Ensure extra files for a model are downloaded.
|
|
118
|
-
* Returns the local paths of all extra files.
|
|
119
|
-
*/
|
|
120
|
-
ensureExtraFiles(modelId: string): Promise<readonly string[]>;
|
|
121
|
-
/** Absolute path to the shared models directory. */
|
|
122
|
-
getModelsDir(): string;
|
|
123
|
-
/** Check if a model file is already present on disk. */
|
|
124
|
-
isDownloaded(modelId: string, format?: ModelFormat): boolean;
|
|
125
|
-
/**
|
|
126
|
-
* Legacy API: download a model by ID (delegates to ensure with default format).
|
|
127
|
-
* Required by IAddonModelManager interface.
|
|
128
|
-
*/
|
|
129
|
-
downloadModel(id: string): Promise<string>;
|
|
130
|
-
/** Get the catalog entry for a model by ID. */
|
|
131
|
-
getEntry(modelId: string): ModelCatalogEntry | undefined;
|
|
132
|
-
private pickDefaultFormat;
|
|
133
|
-
private modelFilePath;
|
|
134
|
-
/**
|
|
135
|
-
* Download a directory bundle (e.g., .mlpackage) from HuggingFace.
|
|
136
|
-
* ATOMIC: downloads to temp dir, renames only on complete success.
|
|
137
|
-
*/
|
|
138
|
-
private downloadDirectory;
|
|
139
|
-
/** Recursively list all files in a HuggingFace directory via API. */
|
|
140
|
-
private listHfFiles;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
declare class PythonEnvManager implements IPythonEnvironment {
|
|
144
|
-
private readonly dataDir;
|
|
145
|
-
private venvPath;
|
|
146
|
-
private cachedProbe;
|
|
147
|
-
constructor(dataDir: string);
|
|
148
|
-
probe(): Promise<PythonProbeResult>;
|
|
149
|
-
ensure(options: {
|
|
150
|
-
packages: readonly string[];
|
|
151
|
-
}): Promise<PythonEnvReady>;
|
|
152
|
-
spawn(script: string, args: readonly string[]): ChildProcess;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
declare class PipelineValidator {
|
|
156
|
-
private readonly loader;
|
|
157
|
-
constructor(loader: AddonLoader);
|
|
158
|
-
validate(config: PipelineConfig): ValidationResult;
|
|
159
|
-
private validateNode;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
declare class PipelineRunner {
|
|
163
|
-
private readonly engineManager;
|
|
164
|
-
private readonly addonConfigs;
|
|
165
|
-
constructor(engineManager: AddonEngineManager, addonConfigs: Map<string, Record<string, unknown>>);
|
|
166
|
-
run(frame: FrameInput, config: PipelineConfig): Promise<PipelineResult>;
|
|
167
|
-
/**
|
|
168
|
-
* Run only the audio classification node on an audio chunk.
|
|
169
|
-
* Used by the audio path in DetectionWiringService (separate from video pipeline).
|
|
170
|
-
*/
|
|
171
|
-
runAudioNode(chunk: AudioChunkInput, audioNode: PipelineNode): Promise<PipelineResult>;
|
|
172
|
-
private executeNode;
|
|
173
|
-
private executeChildren;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
type ProcessState = ElementState$1;
|
|
177
|
-
|
|
178
|
-
/** Event emitter for process lifecycle events */
|
|
179
|
-
type ProcessEventEmitter = {
|
|
180
|
-
emitProcessCrashed(processId: string, code: number | null, signal: string | null, restartCount: number): void;
|
|
181
|
-
emitProcessRestartScheduled(processId: string, restartCount: number, delayMs: number): void;
|
|
182
|
-
emitProcessRestarted(processId: string, restartCount: number): void;
|
|
183
|
-
};
|
|
184
|
-
/** Re-export LoggerFactory as ProcessLoggerFactory for backward compatibility */
|
|
185
|
-
type ProcessLoggerFactory = LoggerFactory;
|
|
186
|
-
|
|
187
|
-
declare class ManagedProcess {
|
|
188
|
-
private readonly config;
|
|
189
|
-
private readonly events;
|
|
190
|
-
private readonly logger;
|
|
191
|
-
private childProcess;
|
|
192
|
-
private _state;
|
|
193
|
-
private _startedAt?;
|
|
194
|
-
private restartTimer?;
|
|
195
|
-
private _restartCount;
|
|
196
|
-
private _lastCrashAt?;
|
|
197
|
-
private _lastCrashError?;
|
|
198
|
-
constructor(config: ProcessConfig, events: ProcessEventEmitter, logger: IScopedLogger);
|
|
199
|
-
get state(): ProcessState;
|
|
200
|
-
start(): Promise<void>;
|
|
201
|
-
stop(): Promise<void>;
|
|
202
|
-
getStatus(): ManagedProcessStatus;
|
|
203
|
-
private scheduleRestart;
|
|
204
|
-
private getStats;
|
|
205
|
-
private getNextRestartTime;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
declare class ProcessManager {
|
|
209
|
-
private readonly events;
|
|
210
|
-
private readonly loggerFactory;
|
|
211
|
-
private readonly processes;
|
|
212
|
-
constructor(events: ProcessEventEmitter, loggerFactory: ProcessLoggerFactory);
|
|
213
|
-
register(config: ProcessConfig): ManagedProcess;
|
|
214
|
-
start(id: string): Promise<void>;
|
|
215
|
-
stop(id: string): Promise<void>;
|
|
216
|
-
restart(id: string): Promise<void>;
|
|
217
|
-
get(id: string): ManagedProcess;
|
|
218
|
-
listAll(): readonly ManagedProcessStatus[];
|
|
219
|
-
shutdownAll(): Promise<void>;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
declare class NetworkQualityTracker implements INetworkQualityTracker {
|
|
223
|
-
private readonly devices;
|
|
224
|
-
private static readonly MAX_SAMPLES;
|
|
225
|
-
reportStreamStats(deviceId: string, streamId: string, bitrateKbps: number, packetLoss?: number): void;
|
|
226
|
-
reportClientStats(deviceId: string, stats: Omit<ClientNetworkStats, 'lastUpdated'>): void;
|
|
227
|
-
getDeviceStats(deviceId: string): DeviceNetworkStats | null;
|
|
228
|
-
getAllStats(): readonly DeviceNetworkStats[];
|
|
229
|
-
private getOrCreateDevice;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
interface ReplScope {
|
|
233
|
-
readonly type: 'system' | 'provider' | 'device' | 'addon';
|
|
234
|
-
readonly providerId?: string;
|
|
235
|
-
readonly deviceId?: string;
|
|
236
|
-
readonly addonId?: string;
|
|
237
|
-
}
|
|
238
|
-
interface ReplSessionContext {
|
|
239
|
-
readonly scope: ReplScope;
|
|
240
|
-
/** Pre-populated variables available in the REPL session */
|
|
241
|
-
readonly variables: Record<string, unknown>;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
interface IReplEngine {
|
|
245
|
-
execute(code: string, context: ReplSessionContext): Promise<ReplResult>;
|
|
246
|
-
getCompletions(partial: string, context: ReplSessionContext): Promise<string[]>;
|
|
247
|
-
}
|
|
248
|
-
/**
|
|
249
|
-
* Context provider that the server kernel implements.
|
|
250
|
-
* The REPL engine calls this to build the sandbox for each scope type.
|
|
251
|
-
*/
|
|
252
|
-
interface IReplContextProvider {
|
|
253
|
-
getSystemSandbox(): Record<string, unknown>;
|
|
254
|
-
getDeviceSandbox(deviceId: string): Record<string, unknown>;
|
|
255
|
-
getProviderSandbox(providerId: string): Record<string, unknown>;
|
|
256
|
-
getAddonSandbox(addonId: string): Record<string, unknown>;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
declare class ReplEngine implements IReplEngine {
|
|
260
|
-
private readonly contextProvider;
|
|
261
|
-
constructor(contextProvider: IReplContextProvider);
|
|
262
|
-
execute(code: string, context: ReplSessionContext): Promise<ReplResult>;
|
|
263
|
-
getCompletions(partial: string, context: ReplSessionContext): Promise<string[]>;
|
|
264
|
-
private buildSandbox;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
/** Event emitter for agent lifecycle and task events */
|
|
268
|
-
type AgentEventEmitter = {
|
|
269
|
-
emitAgentRegistered(agentId: string, capabilities: readonly string[]): void;
|
|
270
|
-
emitAgentUnregistered(agentId: string): void;
|
|
271
|
-
emitAgentOnline(agentId: string): void;
|
|
272
|
-
emitAgentOffline(agentId: string): void;
|
|
273
|
-
emitTaskDispatched(taskId: string, agentId: string, capability: string): void;
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
declare class AgentRegistry {
|
|
277
|
-
private readonly events;
|
|
278
|
-
private readonly heartbeatTimeoutMs;
|
|
279
|
-
private readonly heartbeatCheckIntervalMs;
|
|
280
|
-
private readonly agents;
|
|
281
|
-
private readonly heartbeatIntervals;
|
|
282
|
-
constructor(events: AgentEventEmitter, heartbeatTimeoutMs?: number, heartbeatCheckIntervalMs?: number);
|
|
283
|
-
/** Register a new agent */
|
|
284
|
-
registerAgent(info: AgentInfo): void;
|
|
285
|
-
/** Remove agent */
|
|
286
|
-
unregisterAgent(id: string): void;
|
|
287
|
-
/** Update heartbeat timestamp */
|
|
288
|
-
heartbeat(id: string): void;
|
|
289
|
-
/** Find agents with a specific capability */
|
|
290
|
-
getAgentsWithCapability(capability: string): readonly AgentEntry[];
|
|
291
|
-
/** Get best agent for a task (least loaded) */
|
|
292
|
-
selectAgent(capability: string, preferredId?: string): AgentEntry | null;
|
|
293
|
-
/** List all agents with status */
|
|
294
|
-
listAgents(): readonly AgentStatus[];
|
|
295
|
-
/** Get single agent */
|
|
296
|
-
getAgent(id: string): AgentEntry | null;
|
|
297
|
-
/** Destroy all heartbeat intervals */
|
|
298
|
-
destroy(): void;
|
|
299
|
-
private startHeartbeatCheck;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
declare class TaskDispatcher {
|
|
303
|
-
private readonly agentRegistry;
|
|
304
|
-
private readonly events;
|
|
305
|
-
private readonly pendingTasks;
|
|
306
|
-
private readonly localExecutors;
|
|
307
|
-
constructor(agentRegistry: AgentRegistry, events: AgentEventEmitter);
|
|
308
|
-
/** Dispatch a task to the best available agent */
|
|
309
|
-
dispatch(task: AgentTask, options?: TaskDispatchOptions): Promise<AgentTaskResult>;
|
|
310
|
-
/** Register a local executor for a capability (in-process fallback) */
|
|
311
|
-
registerLocalExecutor(capability: string, executor: (input: Record<string, unknown>) => Promise<Record<string, unknown>>): void;
|
|
312
|
-
/** Called when an agent returns a result */
|
|
313
|
-
handleTaskResult(result: AgentTaskResult): void;
|
|
314
|
-
private executeLocally;
|
|
315
|
-
private sendToAgent;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
declare class LogRingBuffer {
|
|
319
|
-
private readonly capacity;
|
|
320
|
-
private readonly buffer;
|
|
321
|
-
private head;
|
|
322
|
-
private count;
|
|
323
|
-
constructor(capacity?: number);
|
|
324
|
-
push(entry: LogEntry): void;
|
|
325
|
-
getAll(): LogEntry[];
|
|
326
|
-
query(filter: LogFilter): LogEntry[];
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
declare class ScopedLogger implements IScopedLogger {
|
|
330
|
-
private readonly scope;
|
|
331
|
-
private readonly writeFn;
|
|
332
|
-
constructor(scope: string[], writeFn: (entry: LogEntry) => void);
|
|
333
|
-
debug(message: string, meta?: Record<string, unknown>): void;
|
|
334
|
-
info(message: string, meta?: Record<string, unknown>): void;
|
|
335
|
-
warn(message: string, meta?: Record<string, unknown>): void;
|
|
336
|
-
error(message: string, meta?: Record<string, unknown>): void;
|
|
337
|
-
child(childScope: string): IScopedLogger;
|
|
338
|
-
private write;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
interface AgentClientConfig {
|
|
342
|
-
readonly hubUrl: string;
|
|
343
|
-
readonly token?: string;
|
|
344
|
-
readonly logger: IScopedLogger;
|
|
345
|
-
readonly registrationInfo: AgentRegistrationInfo;
|
|
346
|
-
}
|
|
347
|
-
type MessageHandler = (msg: HubToAgentMessage) => void;
|
|
348
|
-
type BinaryHandler = (data: Buffer) => void;
|
|
349
|
-
type ConnectionHandler = () => void;
|
|
350
|
-
/**
|
|
351
|
-
* WebSocket client for agent mode. Framework-agnostic (no NestJS).
|
|
352
|
-
* Connects to the hub, sends registration, handles messages,
|
|
353
|
-
* reconnects with exponential backoff.
|
|
354
|
-
*/
|
|
355
|
-
declare class AgentClient {
|
|
356
|
-
private ws;
|
|
357
|
-
private reconnectAttempt;
|
|
358
|
-
private reconnectTimer;
|
|
359
|
-
private heartbeatTimer;
|
|
360
|
-
private destroyed;
|
|
361
|
-
private readonly messageHandlers;
|
|
362
|
-
private readonly binaryHandlers;
|
|
363
|
-
private readonly connectHandlers;
|
|
364
|
-
private readonly disconnectHandlers;
|
|
365
|
-
private readonly logger;
|
|
366
|
-
private readonly hubUrl;
|
|
367
|
-
private readonly token?;
|
|
368
|
-
private readonly registrationInfo;
|
|
369
|
-
private runtimeStatus;
|
|
370
|
-
constructor(config: AgentClientConfig);
|
|
371
|
-
/** Connect to the hub WebSocket */
|
|
372
|
-
connect(): Promise<void>;
|
|
373
|
-
/** Disconnect and stop reconnecting */
|
|
374
|
-
disconnect(): void;
|
|
375
|
-
/** Send a JSON control message to the hub */
|
|
376
|
-
send(msg: AgentToHubMessage): void;
|
|
377
|
-
/** Send a binary frame to the hub */
|
|
378
|
-
sendBinary(data: Buffer): void;
|
|
379
|
-
/** Register a handler for JSON messages from hub */
|
|
380
|
-
onMessage(handler: MessageHandler): void;
|
|
381
|
-
/** Register a handler for binary frames from hub */
|
|
382
|
-
onBinaryFrame(handler: BinaryHandler): void;
|
|
383
|
-
/** Register a handler for successful connection */
|
|
384
|
-
onConnect(handler: ConnectionHandler): void;
|
|
385
|
-
/** Register a handler for disconnection */
|
|
386
|
-
onDisconnect(handler: ConnectionHandler): void;
|
|
387
|
-
/** Update the runtime status (used in heartbeat) */
|
|
388
|
-
updateStatus(status: AgentRuntimeStatus): void;
|
|
389
|
-
/** Whether currently connected */
|
|
390
|
-
get connected(): boolean;
|
|
391
|
-
private doConnect;
|
|
392
|
-
private handleBuiltinMessage;
|
|
393
|
-
private scheduleReconnect;
|
|
394
|
-
private startHeartbeat;
|
|
395
|
-
private stopHeartbeat;
|
|
396
|
-
private clearTimers;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
/**
|
|
400
|
-
* Receives task assignments from hub, routes to registered ITaskHandler instances.
|
|
401
|
-
* Maintains handler registry, manages task lifecycle.
|
|
402
|
-
* Framework-agnostic (no NestJS).
|
|
403
|
-
*/
|
|
404
|
-
declare class AgentTaskRunner {
|
|
405
|
-
private readonly agentId;
|
|
406
|
-
private readonly client;
|
|
407
|
-
private readonly handlers;
|
|
408
|
-
private readonly runningTasks;
|
|
409
|
-
private readonly logger;
|
|
410
|
-
constructor(agentId: string, client: AgentClient, logger: IScopedLogger);
|
|
411
|
-
/** Register a task handler for a given task type */
|
|
412
|
-
registerHandler(handler: ITaskHandler): void;
|
|
413
|
-
/** Unregister a task handler */
|
|
414
|
-
unregisterHandler(taskType: string): void;
|
|
415
|
-
/** Get all registered task types */
|
|
416
|
-
getTaskTypes(): readonly string[];
|
|
417
|
-
/** Get a handler by task type */
|
|
418
|
-
getHandler(taskType: string): ITaskHandler | undefined;
|
|
419
|
-
/**
|
|
420
|
-
* Execute a task dispatched from the hub.
|
|
421
|
-
* Sends result or error back to hub via the AgentClient.
|
|
422
|
-
*/
|
|
423
|
-
executeTask(taskId: string, taskType: string, payload: unknown): Promise<void>;
|
|
424
|
-
/** Cancel a running task */
|
|
425
|
-
cancelTask(taskId: string): Promise<void>;
|
|
426
|
-
/** Number of currently running tasks */
|
|
427
|
-
get activeTaskCount(): number;
|
|
428
|
-
/** Destroy: cancel all running tasks */
|
|
429
|
-
destroy(): Promise<void>;
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
/**
|
|
433
|
-
* Stub task handler for pipeline.decode.
|
|
434
|
-
* In the full implementation, this would start a StreamBroker for a camera
|
|
435
|
-
* and send decoded frames to the hub via the AgentClient.
|
|
436
|
-
*/
|
|
437
|
-
declare class DecodeTaskHandler implements ITaskHandler {
|
|
438
|
-
readonly taskType = "pipeline.decode";
|
|
439
|
-
readonly description = "Decode an RTSP stream and produce JPEG frames";
|
|
440
|
-
handle(payload: unknown, context: TaskContext): Promise<unknown>;
|
|
441
|
-
cancel(): Promise<void>;
|
|
442
|
-
}
|
|
443
|
-
/**
|
|
444
|
-
* Stub task handler for pipeline.detect.
|
|
445
|
-
* In the full implementation, this would receive frames (via binary WS),
|
|
446
|
-
* run them through the detection engine, and send results back.
|
|
447
|
-
*/
|
|
448
|
-
declare class DetectTaskHandler implements ITaskHandler {
|
|
449
|
-
readonly taskType = "pipeline.detect";
|
|
450
|
-
readonly description = "Run object detection on received frames";
|
|
451
|
-
handle(payload: unknown, context: TaskContext): Promise<unknown>;
|
|
452
|
-
cancel(): Promise<void>;
|
|
453
|
-
}
|
|
454
|
-
/**
|
|
455
|
-
* Stub task handler for pipeline.record.
|
|
456
|
-
* In the full implementation, this would start recording an RTSP stream
|
|
457
|
-
* to disk in segments and report segment metadata back to the hub.
|
|
458
|
-
*/
|
|
459
|
-
declare class RecordTaskHandler implements ITaskHandler {
|
|
460
|
-
readonly taskType = "pipeline.record";
|
|
461
|
-
readonly description = "Record an RTSP stream to disk segments";
|
|
462
|
-
handle(payload: unknown, context: TaskContext): Promise<unknown>;
|
|
463
|
-
cancel(): Promise<void>;
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
type ElementState = 'stopped' | 'starting' | 'running' | 'stopping' | 'error' | 'disabled';
|
|
467
|
-
interface ElementStatus {
|
|
468
|
-
state: ElementState;
|
|
469
|
-
error?: string;
|
|
470
|
-
startedAt?: number;
|
|
471
|
-
stoppedAt?: number;
|
|
472
|
-
restartCount: number;
|
|
473
|
-
uptime: number;
|
|
474
|
-
}
|
|
475
|
-
declare class LifecycleStateMachine {
|
|
476
|
-
private readonly elementId;
|
|
477
|
-
private readonly elementType;
|
|
478
|
-
private readonly eventBus;
|
|
479
|
-
private readonly logger;
|
|
480
|
-
private _state;
|
|
481
|
-
private _error?;
|
|
482
|
-
private _startedAt?;
|
|
483
|
-
private _stoppedAt?;
|
|
484
|
-
private _restartCount;
|
|
485
|
-
private _hasStartedOnce;
|
|
486
|
-
constructor(elementId: string, elementType: 'provider' | 'device' | 'addon' | 'process', eventBus: IEventBus, logger: IScopedLogger);
|
|
487
|
-
get state(): ElementState;
|
|
488
|
-
getStatus(): ElementStatus;
|
|
489
|
-
transition(to: ElementState, error?: string): boolean;
|
|
490
|
-
incrementRestartCount(): void;
|
|
491
|
-
private isValidTransition;
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
type FeatureConfigReader = {
|
|
495
|
-
readonly features: FeatureManifest;
|
|
496
|
-
};
|
|
497
|
-
declare class FeatureManager {
|
|
498
|
-
private readonly configReader;
|
|
499
|
-
constructor(configReader: FeatureConfigReader);
|
|
500
|
-
isEnabled(flag: FeatureFlag): boolean;
|
|
501
|
-
getManifest(): FeatureManifest;
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
declare class SystemEventBus implements IEventBus {
|
|
505
|
-
private readonly ringBuffer;
|
|
506
|
-
private readonly subscribers;
|
|
507
|
-
constructor(bufferSize?: number);
|
|
508
|
-
emit(event: SystemEvent): void;
|
|
509
|
-
subscribe(filter: EventFilter, handler: (event: SystemEvent) => void): () => void;
|
|
510
|
-
getRecent(filter?: EventFilter, limit?: number): readonly SystemEvent[];
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
interface ILogDestination {
|
|
514
|
-
initialize(): Promise<void>;
|
|
515
|
-
shutdown(): Promise<void>;
|
|
516
|
-
write(entry: LogEntry): void;
|
|
517
|
-
query?(filter: LogFilter): Promise<readonly LogEntry[]>;
|
|
518
|
-
}
|
|
519
|
-
declare class LogManager {
|
|
520
|
-
private readonly ringBuffer;
|
|
521
|
-
private readonly destinations;
|
|
522
|
-
private readonly subscribers;
|
|
523
|
-
constructor(bufferSize?: number);
|
|
524
|
-
createLogger(scope: string): IScopedLogger;
|
|
525
|
-
/** Subscribe to live logs matching a filter. Returns an unsubscribe function. */
|
|
526
|
-
subscribe(filter: Partial<LogFilter>, callback: (entry: LogEntry) => void): () => void;
|
|
527
|
-
private matchesFilter;
|
|
528
|
-
addDestination(dest: ILogDestination): void;
|
|
529
|
-
removeDestination(dest: ILogDestination): void;
|
|
530
|
-
query(filter: LogFilter): LogEntry[];
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
interface IStorageBackend {
|
|
534
|
-
/** Backend type identifier */
|
|
535
|
-
readonly type: string;
|
|
536
|
-
/** Base path of this backend */
|
|
537
|
-
readonly basePath: string;
|
|
538
|
-
/** Resolve a subpath to an absolute path */
|
|
539
|
-
resolve(subpath: string): string;
|
|
540
|
-
/** Check if the backend path exists and is writable */
|
|
541
|
-
isAvailable(): boolean;
|
|
542
|
-
/** Ensure base directory exists (mkdir -p equivalent) */
|
|
543
|
-
initialize(): Promise<void>;
|
|
544
|
-
}
|
|
545
|
-
declare class FsStorageBackend implements IStorageBackend {
|
|
546
|
-
readonly type = "local";
|
|
547
|
-
readonly basePath: string;
|
|
548
|
-
constructor(basePath: string);
|
|
549
|
-
resolve(subpath: string): string;
|
|
550
|
-
isAvailable(): boolean;
|
|
551
|
-
initialize(): Promise<void>;
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
type StorageLocationName = 'data' | 'media' | 'recordings' | 'models' | 'cache' | 'logs';
|
|
555
|
-
declare class StorageLocationManager {
|
|
556
|
-
private readonly backends;
|
|
557
|
-
private readonly dataPath;
|
|
558
|
-
constructor(dataPath: string);
|
|
559
|
-
/** Initialize all locations with default paths */
|
|
560
|
-
initializeDefaults(): Promise<void>;
|
|
561
|
-
/** Override a specific location's backend path */
|
|
562
|
-
setLocationPath(name: StorageLocationName, basePath: string): Promise<void>;
|
|
563
|
-
/** Get the backend for a location */
|
|
564
|
-
getBackend(name: StorageLocationName): IStorageBackend;
|
|
565
|
-
/** Resolve a path within a location */
|
|
566
|
-
resolve(location: StorageLocationName, subpath: string): string;
|
|
567
|
-
/** Check if all locations are available */
|
|
568
|
-
getStatus(): Array<{
|
|
569
|
-
name: StorageLocationName;
|
|
570
|
-
available: boolean;
|
|
571
|
-
path: string;
|
|
572
|
-
}>;
|
|
573
|
-
/** All location names */
|
|
574
|
-
getLocationNames(): StorageLocationName[];
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
interface IStorageProvider {
|
|
578
|
-
initialize(): Promise<void>;
|
|
579
|
-
shutdown(): Promise<void>;
|
|
580
|
-
getLocation(name: StorageLocationName): IStorageLocation;
|
|
581
|
-
export?(locationName: StorageLocationName): Promise<Buffer>;
|
|
582
|
-
import?(locationName: StorageLocationName, data: Buffer): Promise<void>;
|
|
583
|
-
}
|
|
584
|
-
interface QueryFilter {
|
|
585
|
-
where?: Record<string, unknown>;
|
|
586
|
-
whereIn?: Record<string, unknown[]>;
|
|
587
|
-
whereBetween?: Record<string, [unknown, unknown]>;
|
|
588
|
-
orderBy?: {
|
|
589
|
-
field: string;
|
|
590
|
-
direction: 'asc' | 'desc';
|
|
591
|
-
};
|
|
592
|
-
limit?: number;
|
|
593
|
-
offset?: number;
|
|
594
|
-
}
|
|
595
|
-
interface StorageRecord {
|
|
596
|
-
collection: string;
|
|
597
|
-
id: string;
|
|
598
|
-
data: Record<string, unknown>;
|
|
599
|
-
}
|
|
600
|
-
interface IStructuredStorage {
|
|
601
|
-
query(collection: string, filter?: QueryFilter): Promise<readonly StorageRecord[]>;
|
|
602
|
-
insert(record: StorageRecord): Promise<StorageRecord>;
|
|
603
|
-
update(collection: string, id: string, data: Record<string, unknown>): Promise<StorageRecord>;
|
|
604
|
-
delete(collection: string, id: string): Promise<void>;
|
|
605
|
-
count(collection: string, filter?: QueryFilter): Promise<number>;
|
|
606
|
-
}
|
|
607
|
-
interface IFileStorage {
|
|
608
|
-
readFile(path: string): Promise<Buffer>;
|
|
609
|
-
writeFile(path: string, data: Buffer): Promise<void>;
|
|
610
|
-
deleteFile(path: string): Promise<void>;
|
|
611
|
-
listFiles(prefix?: string): Promise<readonly string[]>;
|
|
612
|
-
getFileUrl(path: string): Promise<string>;
|
|
613
|
-
exists(path: string): Promise<boolean>;
|
|
614
|
-
}
|
|
615
|
-
interface IStorageLocation {
|
|
616
|
-
structured?: IStructuredStorage;
|
|
617
|
-
files?: IFileStorage;
|
|
618
|
-
}
|
|
619
|
-
/**
|
|
620
|
-
* StorageManager — bridge between legacy code (getLocation/getLocationPath)
|
|
621
|
-
* and the new capability-based storage system.
|
|
622
|
-
*
|
|
623
|
-
* Legacy consumers call getLocation('addon', namespace) to get structured + file storage.
|
|
624
|
-
* This manager builds the response from:
|
|
625
|
-
* - SettingsBackend (for structured queries) — provided by sqlite-settings addon
|
|
626
|
-
* - LocationManager (for file paths) — set during Phase 2 boot
|
|
627
|
-
*/
|
|
628
|
-
declare class StorageManager {
|
|
629
|
-
private legacyProvider;
|
|
630
|
-
private locationManager;
|
|
631
|
-
private newStorageProvider;
|
|
632
|
-
private settingsBackend;
|
|
633
|
-
/** @deprecated Set by legacy capability consumer — use setNewStorageProvider instead */
|
|
634
|
-
setProvider(provider: IStorageProvider | IStorageProvider$1): void;
|
|
635
|
-
setNewStorageProvider(provider: IStorageProvider$1): void;
|
|
636
|
-
setSettingsBackend(backend: ISettingsBackend): void;
|
|
637
|
-
getProvider(): IStorageProvider;
|
|
638
|
-
setLocationManager(manager: StorageLocationManager): void;
|
|
639
|
-
getLocationManager(): StorageLocationManager;
|
|
640
|
-
initializeLocations(dataPath: string): Promise<void>;
|
|
641
|
-
getLocationPath(name: StorageLocationName): string;
|
|
642
|
-
/**
|
|
643
|
-
* Get a storage location with optional namespace scoping.
|
|
644
|
-
* Builds IStorageLocation from settingsBackend (structured) + locationManager (files).
|
|
645
|
-
*/
|
|
646
|
-
getLocation(name: StorageLocationName | string, namespace?: string): IStorageLocation;
|
|
647
|
-
private createLegacyShim;
|
|
648
|
-
private createNamespacedLocation;
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
/**
|
|
652
|
-
* Manages scoped API tokens with restricted addon/route/capability access.
|
|
653
|
-
* Framework-agnostic — dependencies injected via constructor.
|
|
654
|
-
*/
|
|
655
|
-
declare class ScopedTokenManager {
|
|
656
|
-
private readonly storage;
|
|
657
|
-
constructor(storage: IStructuredStorage);
|
|
658
|
-
/**
|
|
659
|
-
* Create a new scoped token. Returns the raw token string (shown once)
|
|
660
|
-
* and the stored record (with hash, not the raw token).
|
|
661
|
-
*/
|
|
662
|
-
create(userId: string, name: string, scopes: TokenScope[], expiresAt?: number): Promise<{
|
|
663
|
-
token: string;
|
|
664
|
-
record: ScopedToken;
|
|
665
|
-
}>;
|
|
666
|
-
/**
|
|
667
|
-
* Validate a raw token string. Returns the token record if valid, null otherwise.
|
|
668
|
-
*/
|
|
669
|
-
validate(rawToken: string): Promise<ScopedToken | null>;
|
|
670
|
-
/**
|
|
671
|
-
* Check whether a token's scopes grant access to the given addon, route, or capability.
|
|
672
|
-
*/
|
|
673
|
-
matchesScope(token: ScopedToken, addonId?: string, routePath?: string, capability?: string): boolean;
|
|
674
|
-
/**
|
|
675
|
-
* Revoke a token by ID.
|
|
676
|
-
*/
|
|
677
|
-
revoke(tokenId: string): Promise<void>;
|
|
678
|
-
/**
|
|
679
|
-
* List all tokens for a user (without exposing the raw token).
|
|
680
|
-
*/
|
|
681
|
-
listForUser(userId: string): Promise<ScopedToken[]>;
|
|
682
|
-
/**
|
|
683
|
-
* Update the lastUsedAt timestamp for a token.
|
|
684
|
-
*/
|
|
685
|
-
updateLastUsed(tokenId: string): Promise<void>;
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
type AuthConfigReader = {
|
|
689
|
-
get<T>(path: string): T;
|
|
690
|
-
update(section: string, data: Record<string, unknown>): void;
|
|
691
|
-
};
|
|
692
|
-
declare class AuthManager {
|
|
693
|
-
private readonly config;
|
|
694
|
-
private readonly jwtSecret;
|
|
695
|
-
private scopedTokenManager;
|
|
696
|
-
constructor(config: AuthConfigReader);
|
|
697
|
-
signToken(payload: Omit<TokenPayload, 'iat' | 'exp'>): string;
|
|
698
|
-
verifyToken(token: string): TokenPayload;
|
|
699
|
-
hashPassword(password: string): Promise<string>;
|
|
700
|
-
comparePassword(password: string, hash: string): Promise<boolean>;
|
|
701
|
-
generateApiKey(): {
|
|
702
|
-
token: string;
|
|
703
|
-
hash: string;
|
|
704
|
-
prefix: string;
|
|
705
|
-
};
|
|
706
|
-
validateApiKey(token: string, storedHash: string): boolean;
|
|
707
|
-
/**
|
|
708
|
-
* Create a service token for agent/worker authentication.
|
|
709
|
-
* Used when forking workers or when agents register.
|
|
710
|
-
*/
|
|
711
|
-
createServiceToken(opts: {
|
|
712
|
-
readonly agentId: string;
|
|
713
|
-
readonly role?: string;
|
|
714
|
-
readonly expiresIn?: string;
|
|
715
|
-
}): string;
|
|
716
|
-
/**
|
|
717
|
-
* Set the scoped token manager for the auth chain.
|
|
718
|
-
*/
|
|
719
|
-
setScopedTokenManager(manager: ScopedTokenManager): void;
|
|
720
|
-
/**
|
|
721
|
-
* Validate a scoped token string.
|
|
722
|
-
* Returns the token record if valid, null otherwise.
|
|
723
|
-
*/
|
|
724
|
-
validateScopedToken(rawToken: string): Promise<ScopedToken | null>;
|
|
725
|
-
/**
|
|
726
|
-
* Check whether a scoped token grants access to a given addon/route/capability.
|
|
727
|
-
*/
|
|
728
|
-
matchesScopedTokenScope(token: ScopedToken, addonId?: string, routePath?: string, capability?: string): boolean;
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
interface ApiKeyRecord {
|
|
732
|
-
id: string;
|
|
733
|
-
label: string;
|
|
734
|
-
role: UserRole;
|
|
735
|
-
allowedProviders: string[] | '*';
|
|
736
|
-
allowedDevices: Record<string, string[] | '*'>;
|
|
737
|
-
tokenHash: string;
|
|
738
|
-
tokenPrefix: string;
|
|
739
|
-
createdAt: number;
|
|
740
|
-
lastUsedAt?: number;
|
|
741
|
-
}
|
|
742
|
-
interface CreateApiKeyInput {
|
|
743
|
-
label: string;
|
|
744
|
-
role: UserRole;
|
|
745
|
-
allowedProviders?: string[] | '*';
|
|
746
|
-
allowedDevices?: Record<string, string[] | '*'>;
|
|
747
|
-
}
|
|
748
|
-
type ApiKeyStorageAccess = {
|
|
749
|
-
getStructuredStorage(): IStructuredStorage;
|
|
750
|
-
};
|
|
751
|
-
declare class ApiKeyManager {
|
|
752
|
-
private readonly storageAccess;
|
|
753
|
-
private readonly auth;
|
|
754
|
-
constructor(storageAccess: ApiKeyStorageAccess, auth: AuthManager);
|
|
755
|
-
private get structured();
|
|
756
|
-
create(input: CreateApiKeyInput): Promise<{
|
|
757
|
-
record: ApiKeyRecord;
|
|
758
|
-
token: string;
|
|
759
|
-
}>;
|
|
760
|
-
validateToken(token: string): Promise<ApiKeyRecord | null>;
|
|
761
|
-
listAll(): Promise<Omit<ApiKeyRecord, 'tokenHash'>[]>;
|
|
762
|
-
revoke(id: string): Promise<void>;
|
|
763
|
-
findById(id: string): Promise<ApiKeyRecord | null>;
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
interface CreateUserInput {
|
|
767
|
-
username: string;
|
|
768
|
-
password: string;
|
|
769
|
-
role: UserRole;
|
|
770
|
-
allowedProviders?: string[] | '*';
|
|
771
|
-
allowedDevices?: Record<string, string[] | '*'>;
|
|
772
|
-
}
|
|
773
|
-
type UpdatableUserFields = Partial<Pick<UserRecord, 'role' | 'allowedProviders' | 'allowedDevices'>>;
|
|
774
|
-
type UserStorageAccess = {
|
|
775
|
-
getStructuredStorage(): IStructuredStorage;
|
|
776
|
-
};
|
|
777
|
-
type UserConfigReader = {
|
|
778
|
-
get<T>(path: string): T;
|
|
779
|
-
};
|
|
780
|
-
declare class UserManager {
|
|
781
|
-
private readonly storageAccess;
|
|
782
|
-
private readonly auth;
|
|
783
|
-
private readonly config;
|
|
784
|
-
constructor(storageAccess: UserStorageAccess, auth: AuthManager, config: UserConfigReader);
|
|
785
|
-
private get structured();
|
|
786
|
-
create(input: CreateUserInput): Promise<UserRecord>;
|
|
787
|
-
findByUsername(username: string): Promise<UserRecord | null>;
|
|
788
|
-
findById(id: string): Promise<UserRecord | null>;
|
|
789
|
-
validateCredentials(username: string, password: string): Promise<UserRecord | null>;
|
|
790
|
-
listAll(): Promise<Omit<UserRecord, 'passwordHash'>[]>;
|
|
791
|
-
update(id: string, data: UpdatableUserFields): Promise<void>;
|
|
792
|
-
delete(id: string): Promise<void>;
|
|
793
|
-
resetPassword(id: string, newPassword: string): Promise<void>;
|
|
794
|
-
ensureAdminExists(): Promise<void>;
|
|
795
|
-
}
|
|
796
|
-
|
|
797
|
-
/**
|
|
798
|
-
* Central notification service that routes notifications to configured outputs.
|
|
799
|
-
* Framework-agnostic — dependencies injected via constructor.
|
|
800
|
-
*
|
|
801
|
-
* Outputs are resolved from the CapabilityRegistry's 'notification-output'
|
|
802
|
-
* collection on each call (proxy pattern). Falls back to a local map
|
|
803
|
-
* when no registry is provided (backward compat).
|
|
804
|
-
*/
|
|
805
|
-
declare class NotificationService {
|
|
806
|
-
private readonly logger;
|
|
807
|
-
private readonly localOutputs;
|
|
808
|
-
private readonly routing;
|
|
809
|
-
private readonly rateLimits;
|
|
810
|
-
private readonly lastSent;
|
|
811
|
-
private registry;
|
|
812
|
-
constructor(logger: IScopedLogger);
|
|
813
|
-
/** Set the registry for live output lookup. Called once during boot. */
|
|
814
|
-
setRegistry(registry: CapabilityRegistry): void;
|
|
815
|
-
/** Resolve all outputs — prefers registry, falls back to local map */
|
|
816
|
-
private get outputs();
|
|
817
|
-
/** @deprecated Use registry-based resolution. Kept for backward compat only. */
|
|
818
|
-
addOutput(output: INotificationOutput): void;
|
|
819
|
-
/** @deprecated Use registry-based resolution. Kept for backward compat only. */
|
|
820
|
-
removeOutput(id: string): void;
|
|
821
|
-
setRouting(category: string, outputIds: string[]): void;
|
|
822
|
-
setRateLimit(category: string, minIntervalMs: number): void;
|
|
823
|
-
notify(notification: Notification): Promise<void>;
|
|
824
|
-
getOutputs(): ReadonlyArray<{
|
|
825
|
-
id: string;
|
|
826
|
-
name: string;
|
|
827
|
-
icon: string;
|
|
828
|
-
}>;
|
|
829
|
-
getRouting(): ReadonlyMap<string, string[]>;
|
|
830
|
-
getOutput(id: string): INotificationOutput | undefined;
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
type Unsubscribe = () => void;
|
|
834
|
-
/**
|
|
835
|
-
* Service for broadcasting toast notifications to connected UI clients.
|
|
836
|
-
* Framework-agnostic — integrates with tRPC subscriptions via subscribe().
|
|
837
|
-
*/
|
|
838
|
-
declare class ToastService {
|
|
839
|
-
private readonly listeners;
|
|
840
|
-
/**
|
|
841
|
-
* Subscribe to toast events for a specific user.
|
|
842
|
-
* Returns an unsubscribe function.
|
|
843
|
-
*/
|
|
844
|
-
subscribe(connectionId: string, userId: string, callback: (toast: Toast) => void): Unsubscribe;
|
|
845
|
-
/**
|
|
846
|
-
* Broadcast a toast to all connected clients.
|
|
847
|
-
*/
|
|
848
|
-
broadcast(toast: Toast): void;
|
|
849
|
-
/**
|
|
850
|
-
* Send a toast to a specific user's connections only.
|
|
851
|
-
*/
|
|
852
|
-
sendToUser(userId: string, toast: Toast): void;
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
interface RouteMatch {
|
|
856
|
-
readonly route: IAddonHttpRoute;
|
|
857
|
-
readonly addonId: string;
|
|
858
|
-
readonly params: Record<string, string>;
|
|
859
|
-
}
|
|
860
|
-
/**
|
|
861
|
-
* Registry for dynamic HTTP routes registered by addons.
|
|
862
|
-
* Framework-agnostic — the server HTTP layer queries this registry to dispatch requests.
|
|
863
|
-
*/
|
|
864
|
-
declare class AddonRouteRegistry {
|
|
865
|
-
private readonly routes;
|
|
866
|
-
/**
|
|
867
|
-
* Register all routes from an addon's route provider.
|
|
868
|
-
*/
|
|
869
|
-
registerRoutes(addonId: string, provider: IAddonRouteProvider): void;
|
|
870
|
-
/**
|
|
871
|
-
* Unregister all routes for an addon.
|
|
872
|
-
*/
|
|
873
|
-
unregisterRoutes(addonId: string): void;
|
|
874
|
-
/**
|
|
875
|
-
* Match an incoming request method + path to a registered route.
|
|
876
|
-
* Supports simple path parameters (e.g., /items/:id).
|
|
877
|
-
*/
|
|
878
|
-
matchRoute(method: string, path: string): RouteMatch | null;
|
|
879
|
-
/**
|
|
880
|
-
* List all registered routes across all addons.
|
|
881
|
-
*/
|
|
882
|
-
listRoutes(): ReadonlyArray<{
|
|
883
|
-
addonId: string;
|
|
884
|
-
method: string;
|
|
885
|
-
path: string;
|
|
886
|
-
access: string;
|
|
887
|
-
description?: string;
|
|
888
|
-
}>;
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
interface IRegisteredDevice {
|
|
892
|
-
readonly id: string;
|
|
893
|
-
readonly name: string;
|
|
894
|
-
readonly providerId: string;
|
|
895
|
-
readonly capabilities: readonly string[];
|
|
896
|
-
}
|
|
897
|
-
declare class DeviceRegistry<T extends IRegisteredDevice = IRegisteredDevice> {
|
|
898
|
-
private readonly eventBus;
|
|
899
|
-
private readonly devices;
|
|
900
|
-
private readonly logger;
|
|
901
|
-
constructor(eventBus: IEventBus, loggingService: LoggerFactory);
|
|
902
|
-
registerDevice(device: T): void;
|
|
903
|
-
unregisterDevice(id: string): void;
|
|
904
|
-
getDevice(id: string): T | null;
|
|
905
|
-
listDevices(): T[];
|
|
906
|
-
getDevicesByProvider(providerId: string): T[];
|
|
907
|
-
getDevicesWithCapability(cap: string): T[];
|
|
908
|
-
registerProviderDevices(providerId: string, devices: readonly T[]): void;
|
|
909
|
-
unregisterProviderDevices(providerId: string): void;
|
|
910
|
-
}
|
|
911
|
-
|
|
912
|
-
interface IDeviceCapability {
|
|
913
|
-
kind: string;
|
|
914
|
-
}
|
|
915
|
-
interface CapabilityBinding {
|
|
916
|
-
source: 'native' | 'addon' | 'disabled';
|
|
917
|
-
addonId?: string;
|
|
918
|
-
config?: Record<string, unknown>;
|
|
919
|
-
}
|
|
920
|
-
interface IResolvableDevice {
|
|
921
|
-
readonly id: string;
|
|
922
|
-
readonly capabilities: string[];
|
|
923
|
-
getCapability<T extends IDeviceCapability>(cap: string): T | null;
|
|
924
|
-
}
|
|
925
|
-
interface IAddonRegistryAccess {
|
|
926
|
-
getAddon(addonId: string): unknown | null;
|
|
927
|
-
}
|
|
928
|
-
declare class CapabilityResolver {
|
|
929
|
-
private readonly addonRegistry;
|
|
930
|
-
private readonly bindings;
|
|
931
|
-
constructor(addonRegistry: IAddonRegistryAccess);
|
|
932
|
-
resolve<T extends IDeviceCapability>(device: IResolvableDevice, cap: string): T | null;
|
|
933
|
-
setBinding(deviceId: string, cap: string, binding: CapabilityBinding): void;
|
|
934
|
-
removeBinding(deviceId: string, cap: string): void;
|
|
935
|
-
getBindings(deviceId: string): Partial<Record<string, CapabilityBinding>>;
|
|
936
|
-
getEffectiveCapabilities(device: IResolvableDevice): string[];
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
interface TlsCertPair {
|
|
940
|
-
readonly cert: Buffer;
|
|
941
|
-
readonly key: Buffer;
|
|
942
|
-
}
|
|
943
|
-
interface EnsureTlsResult {
|
|
944
|
-
readonly certPath: string;
|
|
945
|
-
readonly keyPath: string;
|
|
946
|
-
readonly generated: boolean;
|
|
947
|
-
}
|
|
948
|
-
interface CertOptions {
|
|
949
|
-
/** Common Name for the cert (default: 'camstack.local') */
|
|
950
|
-
readonly commonName?: string;
|
|
951
|
-
/** Validity in days (default: 825 — max for browsers) */
|
|
952
|
-
readonly validDays?: number;
|
|
953
|
-
/** Additional SANs (DNS names or IPs) */
|
|
954
|
-
readonly extraSans?: readonly string[];
|
|
955
|
-
}
|
|
956
|
-
/**
|
|
957
|
-
* Ensure a self-signed TLS certificate exists in the given directory.
|
|
958
|
-
* Generates one if missing. Returns paths to cert and key files.
|
|
959
|
-
*/
|
|
960
|
-
declare function ensureTlsCert(dataDir: string, options?: CertOptions): Promise<EnsureTlsResult>;
|
|
961
|
-
/**
|
|
962
|
-
* Load TLS cert+key from files. Returns Buffers suitable for Node.js TLS options.
|
|
963
|
-
*/
|
|
964
|
-
declare function loadTlsCert(certPath: string, keyPath: string): TlsCertPair;
|
|
965
|
-
|
|
966
|
-
/**
|
|
967
|
-
* Factory for creating tRPC clients for addons.
|
|
968
|
-
*
|
|
969
|
-
* Two modes:
|
|
970
|
-
* - Direct caller (in-process): zero overhead, uses createCallerFactory
|
|
971
|
-
* - WSS client (worker/agent): real WebSocket connection to the server
|
|
972
|
-
*/
|
|
973
|
-
interface DirectCallerOptions {
|
|
974
|
-
/** The tRPC router instance (from buildAppRouter) */
|
|
975
|
-
readonly router: unknown;
|
|
976
|
-
/** Context for the caller (user identity, etc.) */
|
|
977
|
-
readonly context: {
|
|
978
|
-
readonly user: {
|
|
979
|
-
readonly id: string;
|
|
980
|
-
readonly username: string;
|
|
981
|
-
readonly role: string;
|
|
982
|
-
};
|
|
983
|
-
};
|
|
984
|
-
}
|
|
985
|
-
interface WssClientOptions {
|
|
986
|
-
/** WebSocket URL (e.g., wss://localhost:4443/trpc) */
|
|
987
|
-
readonly url: string;
|
|
988
|
-
/** Auth token for the connection */
|
|
989
|
-
readonly token: string;
|
|
990
|
-
}
|
|
991
|
-
declare class AddonApiFactory {
|
|
992
|
-
/**
|
|
993
|
-
* Build a WSS URL from host and port.
|
|
994
|
-
*/
|
|
995
|
-
buildWssUrl(host: string, port: number): string;
|
|
996
|
-
/**
|
|
997
|
-
* Create a direct caller -- calls tRPC procedures directly in-process.
|
|
998
|
-
* Zero network overhead. Used for in-process addons and dev mode.
|
|
999
|
-
*
|
|
1000
|
-
* @param options.router - The tRPC router from buildAppRouter()
|
|
1001
|
-
* @param options.context - The auth context (service account)
|
|
1002
|
-
* @returns A tRPC caller that can be used as context.api
|
|
1003
|
-
*/
|
|
1004
|
-
createDirectCaller(options: DirectCallerOptions): Promise<unknown>;
|
|
1005
|
-
/**
|
|
1006
|
-
* Create a WSS tRPC client -- connects to the server via WebSocket.
|
|
1007
|
-
* Used for forked workers and remote agents.
|
|
1008
|
-
*
|
|
1009
|
-
* @param options.url - WSS URL (e.g., wss://localhost:4443/trpc)
|
|
1010
|
-
* @param options.token - Bearer token for authentication
|
|
1011
|
-
* @returns A tRPC client that can be used as context.api
|
|
1012
|
-
*/
|
|
1013
|
-
createWssClient(options: WssClientOptions): Promise<{
|
|
1014
|
-
readonly client: unknown;
|
|
1015
|
-
readonly close: () => void;
|
|
1016
|
-
}>;
|
|
1017
|
-
}
|
|
1018
|
-
|
|
1019
|
-
declare class PlatformScorer {
|
|
1020
|
-
private cached;
|
|
1021
|
-
/** Probe hardware + runtimes and score all backend combos. Cached after first call. */
|
|
1022
|
-
probe(): Promise<PlatformCapabilities>;
|
|
1023
|
-
probeHardware(): Promise<HardwareInfo>;
|
|
1024
|
-
private probeNodeBackends;
|
|
1025
|
-
private probePythonBackends;
|
|
1026
|
-
private scoreBackends;
|
|
1027
|
-
}
|
|
1028
|
-
|
|
1029
|
-
declare class InferenceConfigResolver {
|
|
1030
|
-
private readonly scores;
|
|
1031
|
-
private readonly hardware;
|
|
1032
|
-
constructor(scores: readonly PlatformScore[], hardware: HardwareInfo);
|
|
1033
|
-
/**
|
|
1034
|
-
* Compute accuracy/backend weights based on available system RAM.
|
|
1035
|
-
* availableRAM_MB is now sourced from systeminformation (reliable cross-platform),
|
|
1036
|
-
* not os.freemem() which is broken on macOS.
|
|
1037
|
-
*
|
|
1038
|
-
* - > 16 GB available: prefer larger, more accurate models (accuracy 0.6, backend 0.4)
|
|
1039
|
-
* - > 8 GB available: balanced (accuracy 0.5, backend 0.5)
|
|
1040
|
-
* - <= 8 GB available: prefer speed (accuracy 0.4, backend 0.6)
|
|
1041
|
-
*/
|
|
1042
|
-
private getWeights;
|
|
1043
|
-
/**
|
|
1044
|
-
* Given an addon's model requirements, pick the best model + runtime + backend.
|
|
1045
|
-
*
|
|
1046
|
-
* Algorithm:
|
|
1047
|
-
* 1. Filter models by available RAM (minRAM_MB < 25% of available RAM)
|
|
1048
|
-
* 2. For each remaining model, find the best platform score whose format
|
|
1049
|
-
* is available in the model's formats
|
|
1050
|
-
* 3. Pick the model with the highest combined score using RAM-adaptive weights:
|
|
1051
|
-
* - High RAM (>16 GB): accuracy × 0.6 + backend × 0.4 (prefer accuracy)
|
|
1052
|
-
* - Mid RAM (>8 GB): accuracy × 0.5 + backend × 0.5 (balanced)
|
|
1053
|
-
* - Low RAM (<=8 GB): accuracy × 0.4 + backend × 0.6 (prefer speed)
|
|
1054
|
-
*/
|
|
1055
|
-
resolve(requirements: readonly ModelRequirement[]): ResolvedInferenceConfig;
|
|
1056
|
-
}
|
|
1057
|
-
|
|
1058
|
-
declare class IntegrationRegistry implements IIntegrationRegistry {
|
|
1059
|
-
private readonly backend;
|
|
1060
|
-
constructor(backend: ISettingsBackend);
|
|
1061
|
-
initialize(): Promise<void>;
|
|
1062
|
-
createIntegration(input: CreateIntegrationInput): Integration;
|
|
1063
|
-
getIntegration(id: string): Integration | null;
|
|
1064
|
-
getIntegrationByAddonId(addonId: string): Integration | null;
|
|
1065
|
-
listIntegrations(): readonly Integration[];
|
|
1066
|
-
updateIntegration(id: string, updates: Partial<Pick<Integration, 'name' | 'enabled' | 'info'>>): Integration | null;
|
|
1067
|
-
deleteIntegration(id: string): boolean;
|
|
1068
|
-
getIntegrationSettings(integrationId: string): Record<string, unknown>;
|
|
1069
|
-
setIntegrationSetting(integrationId: string, key: string, value: unknown): void;
|
|
1070
|
-
setIntegrationSettings(integrationId: string, settings: Record<string, unknown>): void;
|
|
1071
|
-
createDevice(input: CreateDeviceInput): Device;
|
|
1072
|
-
getDevice(id: string): Device | null;
|
|
1073
|
-
getDeviceByStableId(stableId: string): Device | null;
|
|
1074
|
-
listDevices(integrationId?: string): readonly Device[];
|
|
1075
|
-
listCameras(): readonly Device[];
|
|
1076
|
-
updateDevice(id: string, updates: Partial<Pick<Device, 'name' | 'enabled' | 'info'>>): Device | null;
|
|
1077
|
-
deleteDevice(id: string): boolean;
|
|
1078
|
-
getDeviceSettings(deviceId: string): Record<string, unknown>;
|
|
1079
|
-
setDeviceSetting(deviceId: string, key: string, value: unknown): void;
|
|
1080
|
-
setDeviceSettings(deviceId: string, settings: Record<string, unknown>): void;
|
|
1081
|
-
private mapIntegration;
|
|
1082
|
-
private mapDevice;
|
|
1083
|
-
}
|
|
1084
|
-
|
|
1085
|
-
/** Minimal device registry interface for provider management */
|
|
1086
|
-
type ProviderDeviceRegistry = {
|
|
1087
|
-
registerProviderDevices(providerId: string, devices: readonly IRegistrableDevice[]): void;
|
|
1088
|
-
unregisterProviderDevices(providerId: string): void;
|
|
1089
|
-
};
|
|
1090
|
-
interface IRegistrableDevice {
|
|
1091
|
-
readonly id: string;
|
|
1092
|
-
readonly name: string;
|
|
1093
|
-
readonly providerId: string;
|
|
1094
|
-
readonly capabilities: readonly string[];
|
|
1095
|
-
}
|
|
1096
|
-
interface ProviderStatus {
|
|
1097
|
-
connected: boolean;
|
|
1098
|
-
error?: string;
|
|
1099
|
-
deviceCount: number;
|
|
1100
|
-
}
|
|
1101
|
-
interface LiveEvent {
|
|
1102
|
-
type: string;
|
|
1103
|
-
camera: string;
|
|
1104
|
-
timestamp: number;
|
|
1105
|
-
data: Record<string, unknown>;
|
|
1106
|
-
}
|
|
1107
|
-
interface IManagedProvider {
|
|
1108
|
-
readonly id: string;
|
|
1109
|
-
readonly type: string;
|
|
1110
|
-
readonly name: string;
|
|
1111
|
-
start(): Promise<void>;
|
|
1112
|
-
stop(): Promise<void>;
|
|
1113
|
-
getStatus(): ProviderStatus;
|
|
1114
|
-
getDevices(): readonly IRegistrableDevice[];
|
|
1115
|
-
subscribeLiveEvents(callback: (event: LiveEvent) => void): () => void;
|
|
1116
|
-
}
|
|
1117
|
-
|
|
1118
|
-
declare class ProviderManager<P extends IManagedProvider = IManagedProvider> {
|
|
1119
|
-
private readonly deviceRegistry;
|
|
1120
|
-
private readonly eventBus;
|
|
1121
|
-
private readonly loggingService;
|
|
1122
|
-
private readonly providers;
|
|
1123
|
-
private readonly logger;
|
|
1124
|
-
constructor(deviceRegistry: ProviderDeviceRegistry, eventBus: IEventBus, loggingService: LoggerFactory);
|
|
1125
|
-
registerProvider(provider: P): void;
|
|
1126
|
-
startProvider(id: string): Promise<void>;
|
|
1127
|
-
stopProvider(id: string): Promise<void>;
|
|
1128
|
-
disableProvider(id: string): Promise<void>;
|
|
1129
|
-
enableProvider(id: string): Promise<void>;
|
|
1130
|
-
restartProvider(id: string): Promise<void>;
|
|
1131
|
-
getProvider(id: string): P | null;
|
|
1132
|
-
getProviderStatus(id: string): ElementStatus | null;
|
|
1133
|
-
listProviders(): readonly ProviderListItem[];
|
|
1134
|
-
shutdownAll(): Promise<void>;
|
|
1135
|
-
}
|
|
1136
|
-
|
|
1137
|
-
export { AddonApiFactory, AddonRouteRegistry, AgentClient, type AgentClientConfig, type AgentEventEmitter, AgentRegistry, AgentTaskRunner, ApiKeyManager, type ApiKeyRecord, type ApiKeyStorageAccess, type AuthConfigReader, AuthManager, type BinaryHandler, type CapabilityBinding, CapabilityResolver, type CertOptions, type ConnectionHandler, DecodeTaskHandler, DetectTaskHandler, DeviceRegistry, type DirectCallerOptions, type ElementState, type ElementStatus, type EnsureTlsResult, EventBus, type FeatureConfigReader, FeatureManager, FsStorageBackend, type IAddonRegistryAccess, type IStorageProvider as ICoreStorageProvider, type IDeviceCapability, type IFileStorage, type ILogDestination, type IManagedProvider, type IRegisteredDevice, type IReplContextProvider, type IReplEngine, type IResolvableDevice, type IStorageBackend, type IStorageLocation, type IStructuredStorage, InferenceConfigResolver, IntegrationRegistry, LifecycleStateMachine, LogManager, LogRingBuffer, ManagedProcess, type MessageHandler, ModelDownloadService, NetworkQualityTracker, NotificationService, PYTHON_VERSION, PipelineRunner, PipelineValidator, PlatformScorer, type ProcessEventEmitter, type ProcessLoggerFactory, ProcessManager, type ProcessState, type ProviderDeviceRegistry, ProviderManager, PythonEnvManager, type QueryFilter, RecordTaskHandler, ReplEngine, type ReplScope, type ReplSessionContext, ScopedLogger, ScopedTokenManager, StorageLocationManager, type StorageLocationName, StorageManager, type StorageRecord, SystemEventBus, TaskDispatcher, type TlsCertPair, ToastService, type Unsubscribe, type UserConfigReader, UserManager, type UserStorageAccess, type WssClientOptions, buildBinaryPath, downloadBinary, downloadFile, downloadModel, ensureBinary, ensureFfmpeg, ensurePython, ensureTlsCert, fetchJson, findInPath, getFfmpegDownloadUrl, getPlatformInfo, getPythonDownloadUrl, installPythonPackages, loadTlsCert };
|