@camstack/core 0.1.15 → 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 +223 -217
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js.map +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +216 -7
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs.map +1 -1
- 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 +6 -221
- package/dist/builtins/addon-pages-aggregator/index.mjs +2 -9
- 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 +199 -197
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js.map +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +192 -7
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs.map +1 -1
- 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 +6 -201
- package/dist/builtins/addon-widgets-aggregator/index.mjs +2 -9
- 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 +590 -430
- package/dist/builtins/alerts/alerts.addon.js.map +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +595 -7
- package/dist/builtins/alerts/alerts.addon.mjs.map +1 -1
- 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 -443
- package/dist/builtins/alerts/index.mjs +2 -8
- 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 +99 -235
- package/dist/builtins/console-logging/index.js.map +1 -1
- package/dist/builtins/console-logging/index.mjs +95 -9
- package/dist/builtins/console-logging/index.mjs.map +1 -1
- 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 +2125 -2127
- package/dist/builtins/device-manager/device-manager.addon.js.map +1 -1
- package/dist/builtins/device-manager/device-manager.addon.mjs +2145 -7
- package/dist/builtins/device-manager/device-manager.addon.mjs.map +1 -1
- 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 +6 -2156
- package/dist/builtins/device-manager/index.mjs +2 -10
- 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 +150 -291
- package/dist/builtins/hub-forwarder/index.js.map +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +145 -9
- package/dist/builtins/hub-forwarder/index.mjs.map +1 -1
- 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 -623
- package/dist/builtins/local-auth/index.mjs +2 -8
- 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 +6861 -589
- package/dist/builtins/local-auth/local-auth.addon.js.map +1 -1
- package/dist/builtins/local-auth/local-auth.addon.mjs +6883 -7
- package/dist/builtins/local-auth/local-auth.addon.mjs.map +1 -1
- 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 +887 -861
- package/dist/builtins/native-metrics/native-metrics.addon.js.map +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +914 -5
- package/dist/builtins/native-metrics/native-metrics.addon.mjs.map +1 -1
- 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 +481 -491
- package/dist/builtins/snapshot/index.js.map +1 -1
- package/dist/builtins/snapshot/index.mjs +475 -464
- package/dist/builtins/snapshot/index.mjs.map +1 -1
- 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 -0
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.d.ts.map +1 -0
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +312 -56
- 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 -0
- package/dist/builtins/sqlite-storage/index.d.ts.map +1 -0
- package/dist/builtins/sqlite-storage/index.js +229 -1001
- package/dist/builtins/sqlite-storage/index.js.map +1 -1
- package/dist/builtins/sqlite-storage/index.mjs +268 -26
- 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 -0
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.d.ts.map +1 -0
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +586 -653
- 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 +6 -188
- package/dist/builtins/system-config/index.mjs +2 -10
- 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 +227 -180
- package/dist/builtins/system-config/system-config.addon.js.map +1 -1
- package/dist/builtins/system-config/system-config.addon.mjs +226 -7
- package/dist/builtins/system-config/system-config.addon.mjs.map +1 -1
- 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 -0
- package/dist/builtins/winston-logging/index.d.ts.map +1 -0
- package/dist/builtins/winston-logging/index.js +153 -300
- package/dist/builtins/winston-logging/index.js.map +1 -1
- package/dist/builtins/winston-logging/index.mjs +144 -9
- 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 -1696
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7780 -8035
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7707 -2148
- 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 +119 -23
- package/dist/builtins/addon-pages-aggregator/index.js.map +0 -1
- package/dist/builtins/addon-pages-aggregator/index.mjs.map +0 -1
- package/dist/builtins/addon-widgets-aggregator/index.js.map +0 -1
- package/dist/builtins/addon-widgets-aggregator/index.mjs.map +0 -1
- package/dist/builtins/alerts/index.js.map +0 -1
- package/dist/builtins/alerts/index.mjs.map +0 -1
- package/dist/builtins/device-manager/index.js.map +0 -1
- package/dist/builtins/device-manager/index.mjs.map +0 -1
- package/dist/builtins/local-auth/index.js.map +0 -1
- package/dist/builtins/local-auth/index.mjs.map +0 -1
- package/dist/builtins/local-backup/index.js +0 -173
- 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/system-config/index.js.map +0 -1
- package/dist/builtins/system-config/index.mjs.map +0 -1
- package/dist/chunk-2CIYKDRN.mjs +0 -1
- package/dist/chunk-2CIYKDRN.mjs.map +0 -1
- package/dist/chunk-2F76X6NL.mjs +0 -136
- package/dist/chunk-2F76X6NL.mjs.map +0 -1
- package/dist/chunk-2QUFBZ7M.mjs +0 -1
- package/dist/chunk-2QUFBZ7M.mjs.map +0 -1
- package/dist/chunk-3BK2Y7GY.mjs +0 -593
- package/dist/chunk-3BK2Y7GY.mjs.map +0 -1
- package/dist/chunk-4OOHFJHT.mjs +0 -421
- package/dist/chunk-4OOHFJHT.mjs.map +0 -1
- package/dist/chunk-4XHB7IHT.mjs +0 -809
- package/dist/chunk-4XHB7IHT.mjs.map +0 -1
- package/dist/chunk-6M2HSSTQ.mjs +0 -98
- package/dist/chunk-6M2HSSTQ.mjs.map +0 -1
- package/dist/chunk-7FI7SQS7.mjs +0 -135
- package/dist/chunk-7FI7SQS7.mjs.map +0 -1
- package/dist/chunk-ED57RCQE.mjs +0 -171
- package/dist/chunk-ED57RCQE.mjs.map +0 -1
- package/dist/chunk-FZN56HGQ.mjs +0 -626
- package/dist/chunk-FZN56HGQ.mjs.map +0 -1
- package/dist/chunk-GL4OOB25.mjs +0 -51
- package/dist/chunk-GL4OOB25.mjs.map +0 -1
- package/dist/chunk-KDG2NTDB.mjs +0 -137
- package/dist/chunk-KDG2NTDB.mjs.map +0 -1
- package/dist/chunk-NRBQWBDM.mjs +0 -191
- package/dist/chunk-NRBQWBDM.mjs.map +0 -1
- package/dist/chunk-O4V246GG.mjs +0 -2137
- package/dist/chunk-O4V246GG.mjs.map +0 -1
- package/dist/chunk-QT57H266.mjs +0 -163
- package/dist/chunk-QT57H266.mjs.map +0 -1
- package/dist/chunk-QX4RH25I.mjs +0 -141
- package/dist/chunk-QX4RH25I.mjs.map +0 -1
- package/dist/chunk-TB562PZX.mjs +0 -86
- package/dist/chunk-TB562PZX.mjs.map +0 -1
- package/dist/chunk-TDYPZXK5.mjs +0 -1
- package/dist/chunk-TDYPZXK5.mjs.map +0 -1
- package/dist/chunk-UJI4LN5P.mjs +0 -36
- package/dist/chunk-UJI4LN5P.mjs.map +0 -1
- package/dist/chunk-W6RTHQGP.mjs +0 -1
- package/dist/chunk-W6RTHQGP.mjs.map +0 -1
- package/dist/chunk-ZELBCPDC.mjs +0 -369
- package/dist/chunk-ZELBCPDC.mjs.map +0 -1
- package/dist/index.d.mts +0 -1696
- package/dist/resource-monitor-UZUGPIAU.mjs +0 -9
- package/dist/resource-monitor-UZUGPIAU.mjs.map +0 -1
- package/dist/storage-location-manager-HFNB3PCS.mjs +0 -7
- package/dist/storage-location-manager-HFNB3PCS.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-orchestrator.addon.js","names":[],"sources":["../../../src/builtins/storage-orchestrator/storage-orchestrator.service.ts","../../../src/builtins/storage-orchestrator/location-store.ts","../../../src/builtins/storage-orchestrator/storage-orchestrator.addon.ts"],"sourcesContent":["/**\n * Routing core for the `storage-orchestrator` builtin.\n *\n * Owns the in-memory `locationId → StorageLocation` map and the\n * `providerId → IStorageProviderImpl` lookup. Every consumer-facing\n * `storage` cap call lands here:\n * 1. `resolveRef(ref)` — bare type or fully-qualified id → concrete location\n * 2. `getProviderFor(location)` — match `location.providerId` against the\n * live set of `storage-provider` collection providers\n *\n * The provider lookup is injected (`getProviders`) so unit tests can\n * pass fixtures without booting a real CapabilityRegistry. The addon\n * wires the production lookup to\n * `ctx.kernel.capabilityRegistry?.getCollection<IStorageProviderImpl>('storage-provider')`.\n *\n * Task 5 adds first-boot seeding of default locations from each\n * `storage-provider`'s `getProviderInfo().supportedLocationTypes`.\n * Task 6 adds an optional `ILocationStore` for SQLite persistence —\n * `initialize()` hydrates the in-memory map from the store, and every\n * `upsertLocation` / `deleteLocation` mirrors the change to the store.\n * Tests pass `null` (or a fake `ILocationStore`) for in-memory-only\n * operation; production wires `SqliteLocationStore`.\n */\nimport type {\n IScopedLogger,\n IStorageProviderImpl,\n StorageLocation,\n StorageLocationRef,\n StorageLocationType,\n} from '@camstack/types'\nimport {\n StorageLocationTypeSchema,\n DEFAULT_LOCATION_SUBDIRS,\n STORAGE_LOCATION_CARDINALITY,\n} from '@camstack/types'\nimport * as path from 'node:path'\nimport type { ILocationStore } from './location-store.js'\n\nexport interface ListLocationsFilter {\n readonly type?: StorageLocationType\n}\n\n/**\n * Provider lookup callback. Returns the live set of `storage-provider`\n * registrants. Called per-dispatch (cheap registry scan) so newly\n * loaded addons surface immediately.\n */\nexport type StorageProviderLookup = () => readonly IStorageProviderImpl[]\n\nexport class StorageOrchestratorService {\n private readonly locations: Map<string, StorageLocation> = new Map()\n\n constructor(\n private readonly logger: IScopedLogger,\n private readonly getProviders: StorageProviderLookup,\n /**\n * Optional persistence backend. When supplied, `initialize()`\n * hydrates the in-memory map from the store, and every mutation\n * (upsert/delete) mirrors to it. When `null` / `undefined`, the\n * service is in-memory only — the contract used by the existing\n * routing tests, where re-creating the service deliberately\n * forgets every location.\n */\n private readonly locationStore: ILocationStore | null = null,\n ) {}\n\n /**\n * Hydrate the in-memory map from the persistence layer. Called once\n * by the addon during `onInitialize`, before the eager seed pass.\n * Idempotent — running it twice with the same store contents\n * produces the same map. No-op when the service was constructed\n * without a store.\n *\n * Errors loading individual rows are tolerated: the bad row is\n * skipped and logged so a single corrupted record doesn't lock the\n * whole orchestrator out of boot. (The store-side validation pass\n * before insert means only schema-invalid SQL state can produce\n * such a row.)\n */\n async initialize(): Promise<void> {\n if (!this.locationStore) return\n const rows = await this.locationStore.loadAll()\n let upgraded = 0\n for (const loc of rows) {\n // One-shot upgrade for legacy rows seeded before the `isSystem`\n // column existed: seed-shaped ids (`<type>:default`) are always\n // system-protected. Without this, a fresh-from-old-DB boot would\n // expose the bootstrap defaults to operator deletion.\n if (!loc.isSystem && loc.id === `${loc.type}:default`) {\n const upgradedLoc: StorageLocation = { ...loc, isSystem: true }\n this.locations.set(upgradedLoc.id, upgradedLoc)\n // Persist the upgrade so subsequent boots skip the rewrite.\n const store = this.locationStore\n void store.upsert(upgradedLoc).catch((err) => {\n this.logger.warn('storage-orchestrator: isSystem upgrade persist failed', {\n meta: { id: upgradedLoc.id, error: err instanceof Error ? err.message : String(err) },\n })\n })\n upgraded++\n } else {\n this.locations.set(loc.id, loc)\n }\n }\n this.logger.info('storage-orchestrator: hydrated locations from store', {\n meta: { loaded: this.locations.size, isSystemUpgraded: upgraded },\n })\n }\n\n // ── Location CRUD ─────────────────────────────────────────────────────\n\n listLocations(filter?: ListLocationsFilter): readonly StorageLocation[] {\n const all = [...this.locations.values()]\n return filter?.type ? all.filter(l => l.type === filter.type) : all\n }\n\n getDefaultLocation(type: StorageLocationType): StorageLocation | null {\n for (const loc of this.locations.values()) {\n if (loc.type === type && loc.isDefault) return loc\n }\n return null\n }\n\n /**\n * Insert or update a location. If `isDefault: true`, atomically\n * demotes any other default for the same type — operators always see\n * exactly one default per type.\n *\n * When a persistence store is wired (Task 6), the new record AND any\n * implicitly-demoted siblings are persisted before the in-memory map\n * mutation returns. Persistence errors propagate to the caller.\n */\n upsertLocation(input: Omit<StorageLocation, 'createdAt' | 'updatedAt'>): StorageLocation {\n const now = Date.now()\n const existing = this.locations.get(input.id)\n\n // Cardinality guard — singleton types reject \"Add\" attempts (an\n // upsert with no matching `id` already in the map). Editing the\n // existing singleton is fine; adding a parallel one would split\n // state in a way consumers can't reconcile (two `addons-data`\n // roots, two `data` paths for sqlite, …).\n if (!existing) {\n const cardinality = STORAGE_LOCATION_CARDINALITY[input.type]\n if (cardinality === 'singleton') {\n const already = [...this.locations.values()].find(l => l.type === input.type)\n if (already) {\n throw new Error(\n `Storage type \"${input.type}\" is singleton — only one location allowed (existing: \"${already.id}\"). Edit it instead of adding a new one.`,\n )\n }\n }\n }\n // System-protected fields cannot be flipped by the operator. Once\n // a location is seeded as `isSystem: true`, edits preserve that\n // flag — the addon owns the lifecycle, not the operator.\n if (existing?.isSystem === true) {\n input = { ...input, isSystem: true }\n }\n\n const next: StorageLocation = {\n ...input,\n createdAt: existing?.createdAt ?? now,\n updatedAt: now,\n }\n const demoted: StorageLocation[] = []\n if (next.isDefault) {\n for (const [otherId, otherLoc] of this.locations) {\n if (otherLoc.type === next.type && otherLoc.id !== next.id && otherLoc.isDefault) {\n const updated: StorageLocation = { ...otherLoc, isDefault: false, updatedAt: now }\n this.locations.set(otherId, updated)\n demoted.push(updated)\n }\n }\n }\n this.locations.set(next.id, next)\n this.logger.debug('storage-orchestrator: upsertLocation', {\n meta: { id: next.id, type: next.type, providerId: next.providerId, isDefault: next.isDefault },\n })\n // Persistence is best-effort fire-and-forget on the upsert path —\n // the service stays sync (the cap surface awaits provider methods,\n // not the orchestrator's own writes). Errors are surfaced to the\n // logger so an SQLite hiccup doesn't silently desync.\n if (this.locationStore) {\n const store = this.locationStore\n void (async () => {\n try {\n for (const d of demoted) await store.upsert(d)\n await store.upsert(next)\n } catch (err) {\n this.logger.error('storage-orchestrator: upsert persistence failed', {\n meta: { id: next.id, error: err instanceof Error ? err.message : String(err) },\n })\n }\n })()\n }\n return next\n }\n\n /**\n * Remove a location. Refuses to remove the default of a type unless a\n * sibling default exists (defensive — `upsertLocation` already ensures\n * at most one default per type, but the logic guards against future\n * bypass paths e.g. SQLite migration that imports two defaults).\n *\n * Persistence (Task 6) mirrors the delete asynchronously, with errors\n * routed to the logger — see `upsertLocation` for the rationale.\n */\n deleteLocation(id: string): void {\n const loc = this.locations.get(id)\n if (!loc) {\n throw new Error(`Storage location \"${id}\" not found`)\n }\n if (loc.isSystem) {\n throw new Error(\n `Storage location \"${id}\" is system-managed and cannot be deleted. Edit its config (path / providerId) instead.`,\n )\n }\n if (loc.isDefault) {\n const otherDefault = [...this.locations.values()].find(\n l => l.type === loc.type && l.id !== id && l.isDefault,\n )\n if (!otherDefault) {\n throw new Error(\n `Cannot delete default location \"${id}\" for type \"${loc.type}\" — promote another location to default first`,\n )\n }\n }\n this.locations.delete(id)\n if (this.locationStore) {\n const store = this.locationStore\n void store.delete(id).catch((err) => {\n this.logger.error('storage-orchestrator: delete persistence failed', {\n meta: { id, error: err instanceof Error ? err.message : String(err) },\n })\n })\n }\n }\n\n // ── Ref resolution ────────────────────────────────────────────────────\n\n /**\n * Resolve a `StorageLocationRef` to a concrete `StorageLocation`.\n * - bare type (e.g. `'backups'`) → default location of that type\n * - fully-qualified id (e.g. `'backups:nas-01'`) → that exact instance\n *\n * Throws an actionable error when nothing matches — every consumer of\n * the singleton `storage` cap funnels through here, so the error\n * message is what operators see when the orchestrator's view of the\n * world doesn't match expectations.\n */\n resolveRef(ref: StorageLocationRef): StorageLocation {\n if (ref.includes(':')) {\n const loc = this.locations.get(ref)\n if (!loc) {\n throw new Error(`Storage location \"${ref}\" not found`)\n }\n return loc\n }\n // Bare-type form — must match one of the closed enum values.\n const parsed = StorageLocationTypeSchema.safeParse(ref)\n if (!parsed.success) {\n throw new Error(\n `Invalid storage location ref \"${ref}\" — expected a StorageLocationType or a fully-qualified id (\\`<type>:<slug>\\`)`,\n )\n }\n const def = this.getDefaultLocation(parsed.data)\n if (!def) {\n throw new Error(\n `No default storage location configured for type \"${parsed.data}\" — register one or pass a fully-qualified id (\\`<type>:<slug>\\`)`,\n )\n }\n return def\n }\n\n // ── Provider lookup ───────────────────────────────────────────────────\n\n /**\n * Find the storage-provider that backs a given location. Lookup is by\n * `location.providerId` against `getProviderInfo().providerId` from\n * each registered collection provider. Throws with both the missing\n * providerId and the offending location id so the operator can pick\n * the right place to fix the config.\n */\n async getProviderFor(location: StorageLocation): Promise<IStorageProviderImpl> {\n const providers = this.getProviders()\n for (const p of providers) {\n const info = await p.getProviderInfo()\n if (info.providerId === location.providerId) return p\n }\n throw new Error(\n `No storage-provider registered for providerId \"${location.providerId}\" (location \"${location.id}\")`,\n )\n }\n\n /** Convenience: lookup by id (returns `undefined` if not found). */\n getLocationById(id: string): StorageLocation | undefined {\n return this.locations.get(id)\n }\n\n // ── First-boot seeding (Task 5) ───────────────────────────────────────\n\n /**\n * Seed one default `StorageLocation` per `supportedTypes` entry that\n * doesn't already have one. Idempotent — re-running with the same\n * provider info on a populated map is a no-op (each entry already\n * resolves on `id === <type>:default`).\n *\n * Convention: the bare-type ref `'backups'` resolves via\n * `getDefaultLocation('backups')` (walks `isDefault === true`); the\n * actual stored `id` is `'backups:default'` so it satisfies the\n * `^[a-z][a-z0-9-]*:[a-z0-9-]+$` regex on `StorageLocationSchema.id`.\n *\n * `basePath` is the provider's storage root (e.g. the filesystem\n * provider's `<CAMSTACK_DATA>` dir). Each location's `config.basePath`\n * is set to `<basePath>/<DEFAULT_LOCATION_SUBDIRS[type]>` — except\n * when the subdir is already absolute (today only `cache` →\n * `/tmp/camstack-cache`), in which case it's used verbatim. The\n * filesystem provider re-derives the same path on its own — this\n * config field is purely an operator-visible record of what was\n * provisioned. Task 7 will refactor providers to honour the\n * location's `config.basePath` directly.\n */\n seedDefaults(input: {\n readonly providerId: string\n readonly supportedTypes: readonly StorageLocationType[]\n readonly basePath: string\n }): void {\n let added = 0\n for (const type of input.supportedTypes) {\n // Skip types already covered for any provider — first wins.\n if (this.hasAnyLocationOfType(type)) continue\n const subdir = DEFAULT_LOCATION_SUBDIRS[type]\n const fullPath = path.isAbsolute(subdir) ? subdir : path.join(input.basePath, subdir)\n const id = `${type}:default`\n this.upsertLocation({\n id,\n type,\n displayName: DEFAULT_DISPLAY_NAMES[type],\n providerId: input.providerId,\n config: { basePath: fullPath },\n isDefault: true,\n // Seeded defaults are system-protected — operators can edit\n // the config (e.g. relocate the path) but cannot delete them\n // outright. Without the seed, consumers (sqlite-settings,\n // backup-orchestrator, recordings, …) lose their target.\n isSystem: true,\n })\n added++\n }\n if (added > 0) {\n this.logger.info('storage-orchestrator: seeded default locations', {\n meta: { providerId: input.providerId, added, basePath: input.basePath },\n })\n }\n }\n\n /** Internal: check whether any location of the given type exists. */\n private hasAnyLocationOfType(type: StorageLocationType): boolean {\n for (const loc of this.locations.values()) {\n if (loc.type === type) return true\n }\n return false\n }\n}\n\n/**\n * Operator-facing names for the default seeded location of each\n * `StorageLocationType`. Kept in this module (not in `interfaces/`)\n * because they're a concern of the orchestrator's seed step — operator\n * UI reads `location.displayName` after seeding.\n */\nconst DEFAULT_DISPLAY_NAMES: Readonly<Record<StorageLocationType, string>> = {\n 'data': 'Local Data',\n 'media': 'Local Media',\n 'recordings': 'Local Recordings',\n 'recordings-high': 'Local Recordings (High)',\n 'recordings-low': 'Local Recordings (Low)',\n 'recordings-clips': 'Local Recordings (Clips)',\n 'event-images': 'Local Event Images',\n 'models': 'Local Models',\n 'addons-data': 'Local Addons Data',\n 'cache': 'Local Cache',\n 'logs': 'Local Logs',\n 'backups': 'Local Backups',\n}\n","/**\n * Persistence layer for the storage-orchestrator's `StorageLocation`\n * map (Task 6 of the storage-unification refactor).\n *\n * The service depends only on the abstract `ILocationStore` —\n * production wires `SqliteLocationStore` (settings-backend-backed),\n * tests pass a fake (in-memory `Map`-backed) implementation. Same\n * pattern as `IntegrationRegistry` in `sqlite-storage/`.\n */\nimport type {\n ISettingsBackend,\n StorageLocation,\n StorageLocationType,\n TableSchema,\n} from '@camstack/types'\nimport { StorageLocationTypeSchema, parseJsonObject } from '@camstack/types'\n\n/**\n * Abstract storage interface for `StorageLocation` records. Methods are\n * async because production-side implementations hit SQLite — but the\n * orchestrator's mutation paths fire-and-forget the writes so a slow\n * disk doesn't block the cap surface.\n */\nexport interface ILocationStore {\n /** Read every persisted location. Called once at boot. */\n loadAll(): Promise<readonly StorageLocation[]>\n /** Insert or replace a single location by id. */\n upsert(loc: StorageLocation): Promise<void>\n /** Remove a location by id. */\n delete(id: string): Promise<void>\n}\n\nconst STORAGE_LOCATIONS_TABLE = 'storage_locations'\n\nconst STORAGE_LOCATIONS_SCHEMA: TableSchema = {\n columns: [\n { name: 'id', type: 'TEXT', primaryKey: true },\n { name: 'type', type: 'TEXT', notNull: true },\n { name: 'display_name', type: 'TEXT', notNull: true },\n { name: 'provider_id', type: 'TEXT', notNull: true },\n { name: 'config', type: 'TEXT', notNull: true, defaultValue: '{}' },\n { name: 'is_default', type: 'INTEGER', notNull: true, defaultValue: 0 },\n { name: 'is_system', type: 'INTEGER', notNull: true, defaultValue: 0 },\n { name: 'created_at', type: 'INTEGER', notNull: true },\n { name: 'updated_at', type: 'INTEGER', notNull: true },\n ],\n indexes: [\n { name: 'idx_storage_locations_type', columns: ['type'] },\n ],\n}\n\n/**\n * SQLite-backed implementation of `ILocationStore` — uses the\n * `settings-store` cap's structured-table surface (`ensureTable` /\n * `tableInsert` / `tableUpdate` / `tableDelete` / `tableQuery`). Wired\n * to the live `ISettingsBackend` provider obtained from\n * `kernel.capabilityRegistry.getSingleton('settings-store')`.\n *\n * The cap-router surface (`ctx.api.settingsStore.*`) does NOT expose\n * the `tableXxx` methods — they're only on the raw `ISettingsBackend`.\n * Same constraint that drives `IntegrationRegistry` to take a direct\n * provider reference instead of going through the cap.\n */\nexport class SqliteLocationStore implements ILocationStore {\n private tableEnsured = false\n\n constructor(private readonly backend: ISettingsBackend) {}\n\n /**\n * Lazy `ensureTable` — keeps the constructor cheap and async-free.\n * Called from every mutation/read path; the backend's `ensureTable`\n * is itself idempotent (additive migration), so repeated calls are\n * effectively no-ops after the first.\n */\n private async ensureTable(): Promise<void> {\n if (this.tableEnsured) return\n if (!this.backend.ensureTable) {\n throw new Error(\n 'SqliteLocationStore: settings backend does not implement ensureTable — ' +\n 'expected the SQLite settings backend, got a backend without structured-table support',\n )\n }\n await this.backend.ensureTable(STORAGE_LOCATIONS_TABLE, STORAGE_LOCATIONS_SCHEMA)\n this.tableEnsured = true\n }\n\n async loadAll(): Promise<readonly StorageLocation[]> {\n await this.ensureTable()\n if (!this.backend.tableQuery) return []\n const rows = await this.backend.tableQuery(STORAGE_LOCATIONS_TABLE, {\n orderBy: { field: 'created_at', direction: 'asc' },\n })\n const out: StorageLocation[] = []\n for (const row of rows) {\n const mapped = mapRowToLocation(row)\n if (mapped) out.push(mapped)\n }\n return out\n }\n\n /**\n * Replace-or-insert. Implemented as `delete` + `insert` rather than\n * the conditional `tableUpdate` path because the orchestrator\n * serializes every mutation through the in-memory map before\n * dispatching to the store — there's no contention to lose, and the\n * delete-then-insert path is unconditionally simpler.\n */\n async upsert(loc: StorageLocation): Promise<void> {\n await this.ensureTable()\n if (!this.backend.tableDelete || !this.backend.tableInsert) {\n throw new Error('SqliteLocationStore: backend missing tableDelete/tableInsert')\n }\n await this.backend.tableDelete(STORAGE_LOCATIONS_TABLE, { id: loc.id })\n await this.backend.tableInsert(STORAGE_LOCATIONS_TABLE, mapLocationToRow(loc))\n }\n\n async delete(id: string): Promise<void> {\n await this.ensureTable()\n if (!this.backend.tableDelete) {\n throw new Error('SqliteLocationStore: backend missing tableDelete')\n }\n await this.backend.tableDelete(STORAGE_LOCATIONS_TABLE, { id })\n }\n}\n\n// ── Row ↔ record mapping ──────────────────────────────────────────────\n\nfunction mapLocationToRow(loc: StorageLocation): Record<string, unknown> {\n return {\n id: loc.id,\n type: loc.type,\n display_name: loc.displayName,\n provider_id: loc.providerId,\n config: JSON.stringify(loc.config),\n is_default: loc.isDefault ? 1 : 0,\n is_system: loc.isSystem ? 1 : 0,\n created_at: loc.createdAt,\n updated_at: loc.updatedAt,\n }\n}\n\n/**\n * Decode a row read from the structured table. Returns `null` when the\n * row's `type` doesn't parse against the Zod enum — the caller skips\n * the row and logs. Defensive against schema drift across upgrades\n * (e.g. an older build wrote a since-removed `recordings-archive`\n * type and the new build no longer recognises it).\n */\nfunction mapRowToLocation(row: Record<string, unknown>): StorageLocation | null {\n const typeRaw = row['type']\n const parsedType = StorageLocationTypeSchema.safeParse(typeRaw)\n if (!parsedType.success) return null\n const type: StorageLocationType = parsedType.data\n\n const id = String(row['id'] ?? '')\n if (!id) return null\n\n // Defensive JSON parse: corrupt rows (hand-edited, written by an\n // older build, partial migration, …) shouldn't lock the\n // orchestrator out of boot — fall back to an empty config and let\n // the location be served with whatever the provider's defaults are.\n const configRaw = row['config']\n const config: Record<string, unknown> = typeof configRaw === 'string' && configRaw.length > 0\n ? (parseJsonObject(configRaw) ?? {})\n : {}\n\n return {\n id,\n type,\n displayName: String(row['display_name'] ?? ''),\n providerId: String(row['provider_id'] ?? ''),\n config,\n isDefault: row['is_default'] === 1 || row['is_default'] === true,\n isSystem: row['is_system'] === 1 || row['is_system'] === true,\n createdAt: Number(row['created_at'] ?? 0),\n updatedAt: Number(row['updated_at'] ?? 0),\n }\n}\n","/**\n * `storage-orchestrator` builtin — singleton owner of the consumer-\n * facing `storage` cap.\n *\n * Responsibilities:\n * - Hold the `locationId → StorageLocation` map (in-memory; Task 6\n * adds persistence).\n * - Resolve `StorageLocationRef` → concrete `StorageLocation`.\n * - Dispatch every cap method to the right `storage-provider`\n * (collection cap, registered by `filesystem-storage` and future\n * SFTP / S3 / WebDAV addons).\n * - Track ownership of upload / download sessions so chunked I/O\n * (which carries no `location` after the first hop) can route\n * subsequent chunks to the same provider.\n * - First-boot seed defaults from each provider's\n * `getProviderInfo().supportedLocationTypes` (Task 5). Re-runs on\n * every `capability:provider-registered` event so providers that\n * register after the orchestrator boots also get seeded — the\n * `hasAnyLocationOfType` guard makes the operation idempotent.\n *\n * Task 6 will plug a persistence backend in front of the in-memory map.\n * Task 7 will migrate consumers off the legacy storage shim.\n */\nimport { BaseAddon, storageCapability } from '@camstack/types'\nimport type {\n IStorageCapProvider,\n IStorageProviderImpl,\n ISettingsBackend,\n ProviderRegistration,\n StorageLocation,\n StorageLocationType,\n IEventBus,\n} from '@camstack/types'\nimport * as path from 'node:path'\nimport { StorageOrchestratorService } from './storage-orchestrator.service.js'\nimport { SqliteLocationStore, type ILocationStore } from './location-store.js'\n\nconst STORAGE_PROVIDER_CAP_NAME = 'storage-provider'\n\n/**\n * Raw event category emitted by `CapabilityRegistry.registerProvider` —\n * not in the typed `EventCategory` enum because it lives in the kernel\n * infra layer (every cap-bound event is a custom-shape payload).\n */\nconst CAP_PROVIDER_REGISTERED_CATEGORY = 'capability:provider-registered'\n\ninterface StorageOrchestratorConfig extends Record<string, unknown> {}\n\nexport class StorageOrchestratorAddon extends BaseAddon<StorageOrchestratorConfig> {\n private service: StorageOrchestratorService | null = null\n\n /**\n * `uploadId` → providerId. Populated on `beginUpload`, consulted on\n * every subsequent `writeChunk` / `finalizeUpload` / `abortUpload`,\n * cleared on terminal calls. The provider holds the actual session\n * state (open file descriptor, buffered offsets, …) — we just\n * remember which provider owns it.\n */\n private readonly uploadOwners: Map<string, string> = new Map()\n /** Symmetric to `uploadOwners` for download sessions. */\n private readonly downloadOwners: Map<string, string> = new Map()\n\n /**\n * Disposers run on `onShutdown` — currently the eventBus subscription\n * for `capability:provider-registered` events used by the lazy seed\n * fallback. Stored separately from the `BaseAddon` disposer chain so\n * it can be inspected in tests.\n */\n private readonly seedSubscriptionDisposers: Array<() => void> = []\n\n constructor() {\n super({})\n }\n\n protected async onInitialize(): Promise<ProviderRegistration[]> {\n const getProviders = (): readonly IStorageProviderImpl[] => {\n const reg = this.ctx.kernel.capabilityRegistry\n if (!reg) return []\n return reg.getCollection<IStorageProviderImpl>(STORAGE_PROVIDER_CAP_NAME)\n }\n\n // Wire the persistence backend (Task 6). Skipped if the\n // settings-store cap hasn't registered a provider yet (e.g. early\n // boot tests, or a deployment without the sqlite-settings builtin\n // mounted) — the service falls back to in-memory only.\n const locationStore = this.resolveLocationStore()\n\n const service = new StorageOrchestratorService(\n this.ctx.logger,\n getProviders,\n locationStore,\n )\n this.service = service\n\n // Hydrate persisted locations BEFORE seeding so re-seeds skip\n // already-persisted defaults (the seed step's\n // `hasAnyLocationOfType` gate looks at the in-memory map).\n await service.initialize()\n\n const provider: IStorageCapProvider = {\n // ── Location management ─────────────────────────────────────────\n listLocations: async ({ type }) => {\n return type !== undefined\n ? service.listLocations({ type })\n : service.listLocations()\n },\n getDefaultLocation: async ({ type }) => service.getDefaultLocation(type),\n upsertLocation: async (input) => service.upsertLocation(input),\n deleteLocation: async ({ id }) => {\n service.deleteLocation(id)\n },\n testLocation: async ({ id }) => {\n const loc = service.getLocationById(id)\n if (!loc) return { ok: false, error: `Location \"${id}\" not found` }\n try {\n const p = await service.getProviderFor(loc)\n return p.testLocation({ config: loc.config })\n } catch (err) {\n return { ok: false, error: err instanceof Error ? err.message : String(err) }\n }\n },\n\n // ── Provider discovery ──────────────────────────────────────────\n // Walk every registered `storage-provider`, collect each one's\n // `getProviderInfo()` blob. Used by the admin-UI \"Add location\"\n // wizard. Errors from individual providers are isolated — a\n // single misbehaving driver shouldn't deny the whole list.\n listProviders: async () => {\n const providers = getProviders()\n const out: Array<{\n providerId: string\n displayName: string\n supportedLocationTypes: readonly StorageLocationType[]\n configSchema: unknown\n }> = []\n for (const p of providers) {\n try {\n const info = await p.getProviderInfo()\n out.push({\n providerId: info.providerId,\n displayName: info.displayName,\n supportedLocationTypes: info.supportedLocationTypes,\n configSchema: info.configSchema,\n })\n } catch (err) {\n this.ctx.logger.warn('storage-orchestrator: getProviderInfo failed', {\n meta: { error: err instanceof Error ? err.message : String(err) },\n })\n }\n }\n return out\n },\n\n // Probe a candidate config against a specific provider WITHOUT\n // persisting. Lets the wizard preflight credentials (SFTP / S3\n // / WebDAV) before the operator commits. Validation errors are\n // returned in `error`; transport errors are caught + reported.\n testConfig: async ({ providerId, config }) => {\n const providers = getProviders()\n for (const p of providers) {\n try {\n const info = await p.getProviderInfo()\n if (info.providerId !== providerId) continue\n return p.testLocation({ config })\n } catch (err) {\n return { ok: false, error: err instanceof Error ? err.message : String(err) }\n }\n }\n return { ok: false, error: `No storage-provider registered for providerId \"${providerId}\"` }\n },\n\n // ── Small-file primitives — every method resolves the ref then\n // dispatches the inline-location form to the provider. ──────────\n resolve: async ({ location, relativePath }) => {\n const loc = service.resolveRef(location)\n const p = await service.getProviderFor(loc)\n return p.resolve({ location: loc, relativePath })\n },\n write: async ({ location, relativePath, data }) => {\n const loc = service.resolveRef(location)\n const p = await service.getProviderFor(loc)\n return p.write({ location: loc, relativePath, data })\n },\n read: async ({ location, relativePath }) => {\n const loc = service.resolveRef(location)\n const p = await service.getProviderFor(loc)\n return p.read({ location: loc, relativePath })\n },\n exists: async ({ location, relativePath }) => {\n const loc = service.resolveRef(location)\n const p = await service.getProviderFor(loc)\n return p.exists({ location: loc, relativePath })\n },\n list: async ({ location, prefix }) => {\n const loc = service.resolveRef(location)\n const p = await service.getProviderFor(loc)\n return prefix !== undefined\n ? p.list({ location: loc, prefix })\n : p.list({ location: loc })\n },\n delete: async ({ location, relativePath }) => {\n const loc = service.resolveRef(location)\n const p = await service.getProviderFor(loc)\n return p.delete({ location: loc, relativePath })\n },\n getAvailableSpace: async ({ location }) => {\n const loc = service.resolveRef(location)\n const p = await service.getProviderFor(loc)\n return p.getAvailableSpace({ location: loc })\n },\n\n // ── Chunked upload — first call records ownership, subsequent\n // calls look it up. Cleanup happens in finalize/abort. ──────────\n beginUpload: async ({ location, relativePath, sizeBytes }) => {\n const loc = service.resolveRef(location)\n const p = await service.getProviderFor(loc)\n const result = sizeBytes !== undefined\n ? await p.beginUpload({ location: loc, relativePath, sizeBytes })\n : await p.beginUpload({ location: loc, relativePath })\n this.uploadOwners.set(result.uploadId, loc.providerId)\n return result\n },\n writeChunk: async (input) => {\n const p = await this.resolveByUploadId(input.uploadId)\n return p.writeChunk(input)\n },\n finalizeUpload: async (input) => {\n const p = await this.resolveByUploadId(input.uploadId)\n try {\n return await p.finalizeUpload(input)\n } finally {\n this.uploadOwners.delete(input.uploadId)\n }\n },\n abortUpload: async (input) => {\n const p = await this.resolveByUploadId(input.uploadId)\n try {\n return await p.abortUpload(input)\n } finally {\n this.uploadOwners.delete(input.uploadId)\n }\n },\n\n // ── Chunked download (symmetric to upload) ──────────────────────\n beginDownload: async ({ location, relativePath }) => {\n const loc = service.resolveRef(location)\n const p = await service.getProviderFor(loc)\n const result = await p.beginDownload({ location: loc, relativePath })\n this.downloadOwners.set(result.downloadId, loc.providerId)\n return result\n },\n readChunk: async (input) => {\n const p = await this.resolveByDownloadId(input.downloadId)\n return p.readChunk(input)\n },\n endDownload: async (input) => {\n const p = await this.resolveByDownloadId(input.downloadId)\n try {\n return await p.endDownload(input)\n } finally {\n this.downloadOwners.delete(input.downloadId)\n }\n },\n }\n\n // Eager seed pass — covers the case where filesystem-storage (or\n // any other storage-provider) already registered before the\n // orchestrator booted. Lazy pass below catches providers that\n // register later.\n await this.seedFromAllProviders()\n\n // Lazy pass — `CapabilityRegistry.registerProvider` emits\n // `capability:provider-registered` on the kernel event bus; we\n // re-run the seed step every time the storage-provider collection\n // grows. `hasAnyLocationOfType` keeps the operation idempotent.\n const eventBus = this.ctx.eventBus as IEventBus | undefined\n if (eventBus) {\n const unsub = eventBus.subscribe(\n { category: CAP_PROVIDER_REGISTERED_CATEGORY },\n (event) => {\n const data = event.data as { capability?: string } | undefined\n if (data?.capability !== STORAGE_PROVIDER_CAP_NAME) return\n // Fire-and-forget: providers register synchronously but\n // `getProviderInfo()` is async. Errors are scoped to the\n // logger inside `seedFromAllProviders`.\n void this.seedFromAllProviders()\n },\n )\n this.seedSubscriptionDisposers.push(unsub)\n }\n\n this.ctx.logger.info('Storage orchestrator initialized')\n return [{ capability: storageCapability, provider }]\n }\n\n protected async onShutdown(): Promise<void> {\n for (const dispose of this.seedSubscriptionDisposers) {\n try { dispose() } catch { /* noop */ }\n }\n this.seedSubscriptionDisposers.length = 0\n this.uploadOwners.clear()\n this.downloadOwners.clear()\n this.service = null\n }\n\n // ── Persistence wiring (Task 6) ─────────────────────────────────────\n\n /**\n * Resolve the live `ISettingsBackend` from the capability registry\n * and wrap it in a `SqliteLocationStore`. Returns `null` when the\n * settings-store cap isn't registered yet — the service falls back\n * to in-memory only. Production boot order (sqlite-settings runs\n * before the orchestrator) makes this the rare path.\n */\n private resolveLocationStore(): ILocationStore | null {\n const reg = this.ctx.kernel.capabilityRegistry\n if (!reg) return null\n const backend = reg.getSingleton<ISettingsBackend>('settings-store')\n if (!backend) {\n this.ctx.logger.warn(\n 'storage-orchestrator: no settings-store provider — running in-memory only',\n )\n return null\n }\n if (!backend.ensureTable || !backend.tableInsert) {\n this.ctx.logger.warn(\n 'storage-orchestrator: settings backend lacks structured-table support — running in-memory only',\n )\n return null\n }\n return new SqliteLocationStore(backend)\n }\n\n // ── Seeding helpers (Task 5) ────────────────────────────────────────\n\n /**\n * Walk every registered `storage-provider` collection provider and\n * call `service.seedDefaults` for each. Idempotent — re-running on\n * a populated map is a no-op (each location's `id` is already in the\n * service's map).\n *\n * `basePath` is derived per-call:\n * - Filesystem providers (and any provider whose `getProviderInfo`\n * doesn't include a `basePath` field) fall back to\n * `process.env.CAMSTACK_DATA ?? path.resolve(process.cwd(), 'camstack-data')`.\n * - Future remote providers (SFTP/S3/WebDAV) will report their own\n * base path through the wizard config — they're not relevant for\n * first-boot seeding (operators add them through the admin UI).\n */\n private async seedFromAllProviders(): Promise<void> {\n if (!this.service) return\n const reg = this.ctx.kernel.capabilityRegistry\n if (!reg) return\n\n const providers = reg.getCollection<IStorageProviderImpl>(STORAGE_PROVIDER_CAP_NAME)\n if (providers.length === 0) return\n\n const basePath = process.env['CAMSTACK_DATA'] ?? path.resolve(process.cwd(), 'camstack-data')\n\n for (const p of providers) {\n try {\n const info = await p.getProviderInfo()\n this.service.seedDefaults({\n providerId: info.providerId,\n supportedTypes: info.supportedLocationTypes,\n basePath,\n })\n } catch (err) {\n this.ctx.logger.warn('storage-orchestrator: seed failed for provider', {\n meta: { error: err instanceof Error ? err.message : String(err) },\n })\n }\n }\n }\n\n // ── Session ownership helpers ─────────────────────────────────────────\n\n private async resolveByUploadId(uploadId: string): Promise<IStorageProviderImpl> {\n const providerId = this.uploadOwners.get(uploadId)\n if (!providerId) {\n throw new Error(`Unknown uploadId \"${uploadId}\" — orchestrator has no record of beginUpload`)\n }\n return this.providerByProviderId(providerId, `uploadId \"${uploadId}\"`)\n }\n\n private async resolveByDownloadId(downloadId: string): Promise<IStorageProviderImpl> {\n const providerId = this.downloadOwners.get(downloadId)\n if (!providerId) {\n throw new Error(`Unknown downloadId \"${downloadId}\" — orchestrator has no record of beginDownload`)\n }\n return this.providerByProviderId(providerId, `downloadId \"${downloadId}\"`)\n }\n\n /**\n * Look up a `storage-provider` by `providerId` only — used for\n * upload / download dispatch where the original `StorageLocation` is\n * no longer in scope. Throws if the provider has gone away (e.g.\n * addon unloaded mid-session).\n */\n private async providerByProviderId(providerId: string, sessionDescriptor: string): Promise<IStorageProviderImpl> {\n if (!this.service) throw new Error('storage-orchestrator: service not initialized')\n // Synthesize a minimal `StorageLocation`-shaped probe — the service\n // only reads `providerId` + `id` for the lookup error message.\n const probe: StorageLocation = {\n id: `__session:${sessionDescriptor}`,\n type: 'data',\n displayName: sessionDescriptor,\n providerId,\n config: {},\n isDefault: false,\n isSystem: false,\n createdAt: 0,\n updatedAt: 0,\n }\n return this.service.getProviderFor(probe)\n }\n}\n\nexport default StorageOrchestratorAddon\n"],"mappings":";;;;;;;;;AAiDA,IAAa,6BAAb,MAAwC;CACtC,4BAA2D,IAAI,KAAK;CAEpE,YACE,QACA,cASA,gBAAwD,MAC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