@camstack/server 1.2.718 → 1.2.720
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/CHANGELOG.md +13 -0
- package/dist/addon-root-inventory.js +1 -1
- package/dist/agent/addon-scan.js +11 -7
- package/dist/agent/agent-addon-updates.js +1 -1
- package/dist/agent/agent-cap-dispatch-service.js +1 -1
- package/dist/agent/agent-heap-watch.js +1 -1
- package/dist/agent/agent-http.js +1 -1
- package/dist/agent/agent-hub-addon-update.js +1 -1
- package/dist/agent/agent-hub-registration.js +1 -1
- package/dist/agent/agent-infra-capabilities.js +2 -2
- package/dist/agent/agent-mesh-gate.js +1 -1
- package/dist/agent/agent-node-certificates.js +1 -1
- package/dist/agent/agent-pairing-routes.js +1 -1
- package/dist/agent/agent-pairing-store.js +1 -1
- package/dist/agent/agent-service.js +6 -2
- package/dist/agent/agent-update-service.js +3 -1
- package/dist/agent/hub-membership-client.js +1 -1
- package/dist/agent/infra-boot-guard.js +2 -2
- package/dist/agent/main.js +9 -9
- package/dist/api/addon-upload.js +1 -1
- package/dist/api/core/addon-settings.router.js +1 -1
- package/dist/api/core/agent-pairing.router.js +1 -1
- package/dist/api/core/auth-device-cert.procedures.js +1 -1
- package/dist/api/core/cap-providers.js +6 -6
- package/dist/api/core/certificates.router.js +1 -1
- package/dist/api/core/lifecycle-job-runner.js +1 -1
- package/dist/api/core/logging-settings.js +1 -1
- package/dist/api/core/logs.router.js +2 -2
- package/dist/api/core/notifications.router.js +1 -1
- package/dist/api/core/preferences.router.js +1 -1
- package/dist/api/core/repl.router.js +1 -1
- package/dist/api/cors/cors-policy.js +1 -1
- package/dist/api/mesh-membership-routes.js +1 -1
- package/dist/api/model-distributor.js +1 -1
- package/dist/api/trpc/cap-route-error-formatter.js +1 -1
- package/dist/api/trpc/cap-router-runtime.js +2 -2
- package/dist/api/trpc/core-cap-bridge.js +1 -1
- package/dist/api/trpc/device-collection-dispatch.js +1 -1
- package/dist/api/trpc/generated-cap-routers.js +1 -1
- package/dist/api/trpc/principal-authorization.js +1 -1
- package/dist/api/trpc/principal-visibility.js +1 -1
- package/dist/api/trpc/scope-access.js +1 -1
- package/dist/api/trpc/trpc.context.js +1 -1
- package/dist/api/trpc/trpc.middleware.js +1 -1
- package/dist/api/trpc/trpc.router.js +3 -3
- package/dist/auth/auth-network-policy.js +1 -1
- package/dist/auth/client-address.js +1 -1
- package/dist/auth/hub-sessions.js +1 -1
- package/dist/auth/session-lifetimes.js +1 -1
- package/dist/auth/sso-finish-deps.js +1 -1
- package/dist/boot/boot-config.js +53 -133
- package/dist/boot/platform-keychain-key.js +1 -1
- package/dist/boot/post-boot.service.js +1 -1
- package/dist/bootstrap-packages.js +3 -3
- package/dist/core/addon/addon-call-gateway.js +1 -1
- package/dist/core/addon/addon-package.service.js +140 -21
- package/dist/core/addon/addon-registry.service.js +36 -32
- package/dist/core/addon/addon-requirements.js +81 -0
- package/dist/core/addon/hub-addon-api.js +1 -1
- package/dist/core/addon/installed-addon-versions.js +82 -0
- package/dist/core/addon/package-dir-utils.js +11 -1
- package/dist/core/addon/settings-door-wiring.js +1 -1
- package/dist/core/addon-bridge/addon-bridge.service.js +3 -3
- package/dist/core/addon-pages/addon-pages.service.js +1 -1
- package/dist/core/agent/agent-desired-set.js +1 -1
- package/dist/core/agent/agent-pairing-http.js +1 -1
- package/dist/core/agent/agent-registry.service.js +41 -7
- package/dist/core/agent/cluster-node-history-store.js +1 -1
- package/dist/core/agent/delivery-requirements.js +36 -0
- package/dist/core/agent/forgotten-node-revoker.js +1 -1
- package/dist/core/agent/node-removal-hooks.js +6 -2
- package/dist/core/auth/auth.service.js +1 -1
- package/dist/core/config/config.schema.js +2 -2
- package/dist/core/config/config.service.js +1 -1
- package/dist/core/events/event-bus.service.js +1 -1
- package/dist/core/feature/feature.service.js +1 -1
- package/dist/core/lifecycle/lifecycle-state-machine.js +2 -2
- package/dist/core/logging/log-history.js +1 -1
- package/dist/core/logging/log-ring-buffer.js +2 -2
- package/dist/core/logging/logging.service.js +2 -2
- package/dist/core/logging/scoped-logger.js +2 -2
- package/dist/core/moleculer/cap-route-authority.js +2 -2
- package/dist/core/moleculer/hub-mesh-guard.js +1 -1
- package/dist/core/moleculer/moleculer.service.js +1 -1
- package/dist/core/network/network-quality.service.js +1 -1
- package/dist/core/notification/notification-wrapper.service.js +1 -1
- package/dist/core/notification/toast-wrapper.service.js +1 -1
- package/dist/core/repl/repl-engine.service.js +1 -1
- package/dist/core/server-update/server-update.service.js +3 -0
- package/dist/core/server-update/system-ensure-prebuilds.js +3 -3
- package/dist/core/server-update/system-exec-npm.js +2 -2
- package/dist/core/storage/fs-storage-backend.js +2 -2
- package/dist/core/storage/storage-location-manager.js +2 -2
- package/dist/core/storage/storage.service.js +1 -1
- package/dist/framework-nodepath.js +14 -1
- package/dist/launcher.js +23 -23
- package/dist/legacy-package-names.js +15 -0
- package/dist/main.js +2 -2
- package/dist/manual-boot.js +4 -3
- package/dist/package-inventory.js +6 -3
- package/dist/server-root/index.js +182 -30
- package/dist/single-copy-cleanup-runner.js +3 -3
- package/dist/single-copy-cleanup.js +19 -14
- package/package.json +53 -19
- package/scripts/closure-postinstall.mjs +1 -1
- package/system/assets/addon-pages-aggregator/icon.svg +5 -0
- package/system/assets/addon-widgets-aggregator/icon.svg +6 -0
- package/system/assets/alert-center/icon.svg +5 -0
- package/system/assets/autotrack/icon.svg +5 -0
- package/system/assets/backup-orchestrator/icon.svg +5 -0
- package/system/assets/calendars/icon.svg +5 -0
- package/system/assets/camera-grid/icon.svg +10 -0
- package/system/assets/composer/icon.svg +7 -0
- package/system/assets/console-logging/icon.svg +4 -0
- package/system/assets/core-blocks/icon.svg +6 -0
- package/system/assets/device-history/icon.svg +4 -0
- package/system/assets/device-manager/icon.svg +6 -0
- package/system/assets/filesystem-storage/icon.svg +6 -0
- package/system/assets/hub-forwarder/icon.svg +7 -0
- package/system/assets/keychain/icon.svg +6 -0
- package/system/assets/liveness-monitor/icon.svg +4 -0
- package/system/assets/local-auth/icon.svg +5 -0
- package/system/assets/local-network/icon.svg +7 -0
- package/system/assets/loki-logging/icon.svg +7 -0
- package/system/assets/metrics-native/icon.svg +3 -0
- package/system/assets/platform-probe/icon.svg +5 -0
- package/system/assets/record-entries/icon.svg +8 -0
- package/system/assets/remote-access-orchestrator/icon.svg +5 -0
- package/system/assets/snapshot/icon.svg +4 -0
- package/system/assets/sqlite-settings/icon.svg +5 -0
- package/system/assets/storage-orchestrator/icon.svg +8 -0
- package/system/assets/system-config/icon.svg +4 -0
- package/system/assets/winston-logging/icon.svg +6 -0
- package/system/dist/addon/addon-api-factory.d.ts +35 -0
- package/system/dist/addon-routes/addon-route-registry.d.ts +37 -0
- package/system/dist/addon-runner.js +11894 -0
- package/system/dist/addon-runner.mjs +11840 -0
- package/system/dist/addon-utils.d.ts +23 -0
- package/system/dist/addon-utils.js +27 -0
- package/system/dist/addon-utils.mjs +3 -0
- package/system/dist/agent-https-BMbnmX5u.mjs +1042 -0
- package/system/dist/agent-https-DslXCDRW.js +1289 -0
- package/system/dist/amd-accelerators-CEuPFBBK.js +36 -0
- package/system/dist/amd-accelerators-U_RsoEDd.mjs +35 -0
- package/system/dist/auth/auth-audit-log.d.ts +45 -0
- package/system/dist/auth/auth-manager.d.ts +155 -0
- package/system/dist/auth/cidr.d.ts +22 -0
- package/system/dist/auth/device-ca-store.d.ts +57 -0
- package/system/dist/auth/device-ca.d.ts +65 -0
- package/system/dist/auth/device-credential-manager.d.ts +158 -0
- package/system/dist/auth/external-identity-manager.d.ts +42 -0
- package/system/dist/auth/jwt-signing-key.d.ts +42 -0
- package/system/dist/auth/legacy-token-tables.d.ts +16 -0
- package/system/dist/auth/login-session-manager.d.ts +140 -0
- package/system/dist/auth/origin.d.ts +34 -0
- package/system/dist/auth/parse-record.d.ts +18 -0
- package/system/dist/auth/scope-matcher.d.ts +8 -0
- package/system/dist/auth/session-revocation-bus.d.ts +32 -0
- package/system/dist/auth/token-expiry.d.ts +62 -0
- package/system/dist/auth/totp-manager.d.ts +107 -0
- package/system/dist/auth/user-management-internal.d.ts +90 -0
- package/system/dist/auth/user-manager.d.ts +69 -0
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.d.ts +57 -0
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +271 -0
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +263 -0
- package/system/dist/builtins/addon-pages-aggregator/dedupe-pages.d.ts +24 -0
- package/system/dist/builtins/addon-pages-aggregator/index.d.ts +1 -0
- package/system/dist/builtins/addon-pages-aggregator/index.js +8 -0
- package/system/dist/builtins/addon-pages-aggregator/index.mjs +2 -0
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.d.ts +57 -0
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +257 -0
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +249 -0
- package/system/dist/builtins/addon-widgets-aggregator/index.d.ts +1 -0
- package/system/dist/builtins/addon-widgets-aggregator/index.js +8 -0
- package/system/dist/builtins/addon-widgets-aggregator/index.mjs +2 -0
- package/system/dist/builtins/alerts/alert-episode-policy.d.ts +39 -0
- package/system/dist/builtins/alerts/alert-store.d.ts +32 -0
- package/system/dist/builtins/alerts/alerts.addon.d.ts +148 -0
- package/system/dist/builtins/alerts/alerts.addon.js +1566 -0
- package/system/dist/builtins/alerts/alerts.addon.mjs +1559 -0
- package/system/dist/builtins/alerts/device-label.d.ts +8 -0
- package/system/dist/builtins/alerts/emit-alert-policy.d.ts +15 -0
- package/system/dist/builtins/alerts/index.d.ts +1 -0
- package/system/dist/builtins/alerts/index.js +4 -0
- package/system/dist/builtins/alerts/index.mjs +2 -0
- package/system/dist/builtins/alerts/migration-alerts.d.ts +13 -0
- package/system/dist/builtins/alerts/prune-policy.d.ts +44 -0
- package/system/dist/builtins/alerts/record-kinds.d.ts +15 -0
- package/system/dist/builtins/alerts/runner-alert.d.ts +58 -0
- package/system/dist/builtins/autotrack/autotrack-cameras.d.ts +125 -0
- package/system/dist/builtins/autotrack/autotrack-config.d.ts +89 -0
- package/system/dist/builtins/autotrack/autotrack-decision.d.ts +86 -0
- package/system/dist/builtins/autotrack/autotrack-loop.d.ts +95 -0
- package/system/dist/builtins/autotrack/autotrack.addon.d.ts +108 -0
- package/system/dist/builtins/autotrack/frame-error.d.ts +50 -0
- package/system/dist/builtins/autotrack/frame-measurements.d.ts +97 -0
- package/system/dist/builtins/autotrack/index.d.ts +2 -0
- package/system/dist/builtins/autotrack/index.js +1018 -0
- package/system/dist/builtins/autotrack/index.mjs +1012 -0
- package/system/dist/builtins/autotrack/ptz-mirror.d.ts +54 -0
- package/system/dist/builtins/autotrack/target-selection.d.ts +46 -0
- package/system/dist/builtins/backup-orchestrator/backup-databases.d.ts +51 -0
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.d.ts +291 -0
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +3213 -0
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +3204 -0
- package/system/dist/builtins/backup-orchestrator/cron-helpers.d.ts +23 -0
- package/system/dist/builtins/backup-orchestrator/destination-policy.d.ts +91 -0
- package/system/dist/builtins/backup-orchestrator/download-helpers.d.ts +12 -0
- package/system/dist/builtins/backup-orchestrator/encryption-key-store.d.ts +49 -0
- package/system/dist/builtins/backup-orchestrator/index.d.ts +2 -0
- package/system/dist/builtins/backup-orchestrator/index.js +8 -0
- package/system/dist/builtins/backup-orchestrator/index.mjs +2 -0
- package/system/dist/builtins/backup-orchestrator/manifest-store.d.ts +134 -0
- package/system/dist/builtins/backup-orchestrator/record-kinds.d.ts +56 -0
- package/system/dist/builtins/backup-orchestrator/restore-archive.d.ts +24 -0
- package/system/dist/builtins/backup-orchestrator/run-queue.d.ts +106 -0
- package/system/dist/builtins/backup-orchestrator/schedule-store.d.ts +59 -0
- package/system/dist/builtins/backup-orchestrator/seed-marker-store.d.ts +26 -0
- package/system/dist/builtins/backup-orchestrator/staging-paths.d.ts +36 -0
- package/system/dist/builtins/backup-orchestrator/write-targets.d.ts +63 -0
- package/system/dist/builtins/calendars/calendar-color.d.ts +9 -0
- package/system/dist/builtins/calendars/calendar-prefs-store.d.ts +34 -0
- package/system/dist/builtins/calendars/calendars.addon.d.ts +19 -0
- package/system/dist/builtins/calendars/calendars.addon.js +227 -0
- package/system/dist/builtins/calendars/calendars.addon.mjs +220 -0
- package/system/dist/builtins/calendars/index.d.ts +1 -0
- package/system/dist/builtins/calendars/index.js +8 -0
- package/system/dist/builtins/calendars/index.mjs +2 -0
- package/system/dist/builtins/calendars/record-kinds.d.ts +18 -0
- package/system/dist/builtins/camera-grid/acquire-retry.d.ts +30 -0
- package/system/dist/builtins/camera-grid/addon.d.ts +205 -0
- package/system/dist/builtins/camera-grid/flv-join.d.ts +40 -0
- package/system/dist/builtins/camera-grid/grid-activity-mirror.d.ts +42 -0
- package/system/dist/builtins/camera-grid/grid-activity.d.ts +91 -0
- package/system/dist/builtins/camera-grid/grid-camera-declarations.d.ts +59 -0
- package/system/dist/builtins/camera-grid/grid-camera-device.d.ts +68 -0
- package/system/dist/builtins/camera-grid/grid-canvas-derivation.d.ts +54 -0
- package/system/dist/builtins/camera-grid/grid-canvas-seed.d.ts +112 -0
- package/system/dist/builtins/camera-grid/grid-canvas.d.ts +85 -0
- package/system/dist/builtins/camera-grid/grid-child.d.ts +32 -0
- package/system/dist/builtins/camera-grid/grid-compositor-child.d.ts +3 -0
- package/system/dist/builtins/camera-grid/grid-compositor-invocation.d.ts +47 -0
- package/system/dist/builtins/camera-grid/grid-compositor.d.ts +54 -0
- package/system/dist/builtins/camera-grid/grid-detection-mapping.d.ts +61 -0
- package/system/dist/builtins/camera-grid/grid-device-settings.d.ts +35 -0
- package/system/dist/builtins/camera-grid/grid-filter-graph.d.ts +53 -0
- package/system/dist/builtins/camera-grid/grid-frame-sample.d.ts +53 -0
- package/system/dist/builtins/camera-grid/grid-instances.d.ts +22 -0
- package/system/dist/builtins/camera-grid/grid-last-frame-store.d.ts +58 -0
- package/system/dist/builtins/camera-grid/grid-layout-native-provider.d.ts +34 -0
- package/system/dist/builtins/camera-grid/grid-plan.d.ts +34 -0
- package/system/dist/builtins/camera-grid/grid-profiles.d.ts +104 -0
- package/system/dist/builtins/camera-grid/grid-row-normalization.d.ts +10 -0
- package/system/dist/builtins/camera-grid/grid-sentry-sources.d.ts +64 -0
- package/system/dist/builtins/camera-grid/grid-snapshot.d.ts +62 -0
- package/system/dist/builtins/camera-grid/grid-stream-descriptor.d.ts +53 -0
- package/system/dist/builtins/camera-grid/grid-stream-invocation.d.ts +44 -0
- package/system/dist/builtins/camera-grid/grid-stream-relay.d.ts +35 -0
- package/system/dist/builtins/camera-grid/grid-stream-session.d.ts +143 -0
- package/system/dist/builtins/camera-grid/grid-tile-feed.d.ts +50 -0
- package/system/dist/builtins/camera-grid/grid-tile-plan.d.ts +66 -0
- package/system/dist/builtins/camera-grid/grid-wire-format.d.ts +30 -0
- package/system/dist/builtins/camera-grid/index.d.ts +45 -0
- package/system/dist/builtins/camera-grid/index.js +3994 -0
- package/system/dist/builtins/camera-grid/index.mjs +3961 -0
- package/system/dist/builtins/camera-grid/silence-analysis.d.ts +37 -0
- package/system/dist/builtins/cluster-agent/record-kinds.d.ts +49 -0
- package/system/dist/builtins/composer/actuator-dispatch.d.ts +13 -0
- package/system/dist/builtins/composer/actuator-groups.d.ts +68 -0
- package/system/dist/builtins/composer/actuator-invoke.d.ts +32 -0
- package/system/dist/builtins/composer/claim-gate.d.ts +59 -0
- package/system/dist/builtins/composer/composed-device-set.d.ts +52 -0
- package/system/dist/builtins/composer/composed-device.d.ts +57 -0
- package/system/dist/builtins/composer/composer-apply-waits.d.ts +28 -0
- package/system/dist/builtins/composer/composer-grafts.d.ts +73 -0
- package/system/dist/builtins/composer/composer-live-set.d.ts +30 -0
- package/system/dist/builtins/composer/composer-plan.d.ts +112 -0
- package/system/dist/builtins/composer/composer-runtime-factory.d.ts +30 -0
- package/system/dist/builtins/composer/composer-seeds.d.ts +28 -0
- package/system/dist/builtins/composer/composer-verdict.d.ts +33 -0
- package/system/dist/builtins/composer/composer.addon.d.ts +26 -0
- package/system/dist/builtins/composer/composer.addon.js +6229 -0
- package/system/dist/builtins/composer/composer.addon.mjs +6223 -0
- package/system/dist/builtins/composer/composer.d.ts +208 -0
- package/system/dist/builtins/composer/composition-declarations.d.ts +64 -0
- package/system/dist/builtins/composer/composition-evaluation.d.ts +53 -0
- package/system/dist/builtins/composer/composition-runtime.d.ts +203 -0
- package/system/dist/builtins/composer/composition-target.d.ts +60 -0
- package/system/dist/builtins/composer/confirmed-seed.d.ts +44 -0
- package/system/dist/builtins/composer/deadline-timer.d.ts +18 -0
- package/system/dist/builtins/composer/existing-target.d.ts +131 -0
- package/system/dist/builtins/composer/field-record.d.ts +64 -0
- package/system/dist/builtins/composer/forward-commands.d.ts +61 -0
- package/system/dist/builtins/composer/graft-host.d.ts +71 -0
- package/system/dist/builtins/composer/held-claims.d.ts +29 -0
- package/system/dist/builtins/composer/history-helpers.d.ts +67 -0
- package/system/dist/builtins/composer/index.d.ts +1 -0
- package/system/dist/builtins/composer/index.js +8 -0
- package/system/dist/builtins/composer/index.mjs +2 -0
- package/system/dist/builtins/composer/math-quantity.d.ts +20 -0
- package/system/dist/builtins/composer/own-field-reads.d.ts +30 -0
- package/system/dist/builtins/composer/owned-fields-target.d.ts +95 -0
- package/system/dist/builtins/composer/pulse-seed-resolve.d.ts +59 -0
- package/system/dist/builtins/composer/pulse-seed.d.ts +75 -0
- package/system/dist/builtins/composer/slice-assembler.d.ts +26 -0
- package/system/dist/builtins/composer/source-readings.d.ts +128 -0
- package/system/dist/builtins/composer/source-tracker.d.ts +135 -0
- package/system/dist/builtins/console-logging/console-destination.d.ts +19 -0
- package/system/dist/builtins/console-logging/console-logging.addon.d.ts +26 -0
- package/system/dist/builtins/console-logging/index.d.ts +3 -0
- package/system/dist/builtins/console-logging/index.js +108 -0
- package/system/dist/builtins/console-logging/index.mjs +99 -0
- package/system/dist/builtins/core-blocks/actions-service.d.ts +113 -0
- package/system/dist/builtins/core-blocks/actions-store.d.ts +32 -0
- package/system/dist/builtins/core-blocks/actions-wiring.d.ts +32 -0
- package/system/dist/builtins/core-blocks/block-package.d.ts +54 -0
- package/system/dist/builtins/core-blocks/block-settings-store.d.ts +93 -0
- package/system/dist/builtins/core-blocks/block-supervisor.d.ts +176 -0
- package/system/dist/builtins/core-blocks/block-type-defs.d.ts +29 -0
- package/system/dist/builtins/core-blocks/blocks-integration.d.ts +89 -0
- package/system/dist/builtins/core-blocks/compile-block.d.ts +52 -0
- package/system/dist/builtins/core-blocks/composition-api.d.ts +50 -0
- package/system/dist/builtins/core-blocks/composition-peers.d.ts +31 -0
- package/system/dist/builtins/core-blocks/composition-sources.d.ts +40 -0
- package/system/dist/builtins/core-blocks/core-block-store.d.ts +120 -0
- package/system/dist/builtins/core-blocks/core-blocks.addon.d.ts +108 -0
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +6374 -0
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +6355 -0
- package/system/dist/builtins/core-blocks/extract-settings-schema.d.ts +6 -0
- package/system/dist/builtins/core-blocks/index.d.ts +8 -0
- package/system/dist/builtins/core-blocks/index.js +21 -0
- package/system/dist/builtins/core-blocks/index.mjs +2 -0
- package/system/dist/builtins/core-blocks/lock-door-gate.d.ts +31 -0
- package/system/dist/builtins/core-blocks/lock-door-sensor.d.ts +35 -0
- package/system/dist/builtins/core-blocks/power-source-service.d.ts +70 -0
- package/system/dist/builtins/core-blocks/record-kinds.d.ts +83 -0
- package/system/dist/builtins/core-blocks/remote-call-redirect.d.ts +23 -0
- package/system/dist/builtins/core-blocks/remote-components-service.d.ts +10 -0
- package/system/dist/builtins/core-blocks/remote-service.d.ts +85 -0
- package/system/dist/builtins/core-blocks/remote-wiring.d.ts +49 -0
- package/system/dist/builtins/core-blocks/runs-api.d.ts +30 -0
- package/system/dist/builtins/core-blocks/runs-ledger.d.ts +64 -0
- package/system/dist/builtins/core-blocks/scheduler/scheduler-engine.d.ts +91 -0
- package/system/dist/builtins/core-blocks/scheduler/scheduler-holds.d.ts +54 -0
- package/system/dist/builtins/core-blocks/scheduler/scheduler-service.d.ts +76 -0
- package/system/dist/builtins/core-blocks/scheduler/scheduler-store.d.ts +23 -0
- package/system/dist/builtins/core-blocks/scheduler/scheduler-timeline.d.ts +53 -0
- package/system/dist/builtins/core-blocks/scheduler/scheduler-trace.d.ts +17 -0
- package/system/dist/builtins/core-blocks/scheduler/scheduler-types.d.ts +20 -0
- package/system/dist/builtins/core-blocks/scheduler/scheduler-wiring.d.ts +41 -0
- package/system/dist/builtins/core-blocks/templates-service.d.ts +24 -0
- package/system/dist/builtins/device-history/capture/capture-engine.d.ts +113 -0
- package/system/dist/builtins/device-history/capture/capture-filter.d.ts +37 -0
- package/system/dist/builtins/device-history/capture/device-directory.d.ts +47 -0
- package/system/dist/builtins/device-history/capture/field-path.d.ts +10 -0
- package/system/dist/builtins/device-history/capture/point-writer.d.ts +63 -0
- package/system/dist/builtins/device-history/device-history.addon.d.ts +53 -0
- package/system/dist/builtins/device-history/device-history.addon.js +2885 -0
- package/system/dist/builtins/device-history/device-history.addon.mjs +2878 -0
- package/system/dist/builtins/device-history/index.d.ts +3 -0
- package/system/dist/builtins/device-history/ingest/producer-ingest.d.ts +99 -0
- package/system/dist/builtins/device-history/query/history-query.d.ts +116 -0
- package/system/dist/builtins/device-history/query/point-shape.d.ts +31 -0
- package/system/dist/builtins/device-history/retention/departure-tracker.d.ts +33 -0
- package/system/dist/builtins/device-history/retention/orphans.d.ts +50 -0
- package/system/dist/builtins/device-history/retention/retention.d.ts +74 -0
- package/system/dist/builtins/device-history/rollup/rollup-engine.d.ts +74 -0
- package/system/dist/builtins/device-history/rollup/rollup-math.d.ts +50 -0
- package/system/dist/builtins/device-history/runtime/history-runtime.d.ts +118 -0
- package/system/dist/builtins/device-history/status/counters.d.ts +55 -0
- package/system/dist/builtins/device-history/store/history-door.d.ts +7 -0
- package/system/dist/builtins/device-history/store/history-schema.d.ts +28 -0
- package/system/dist/builtins/device-history/store/history-store.d.ts +109 -0
- package/system/dist/builtins/device-history/store/row-readers.d.ts +11 -0
- package/system/dist/builtins/device-history/store/series-registry.d.ts +64 -0
- package/system/dist/builtins/device-history/store/series-scale.d.ts +37 -0
- package/system/dist/builtins/device-history/time/bucket-time.d.ts +25 -0
- package/system/dist/builtins/device-manager/adoption-job-engine.d.ts +153 -0
- package/system/dist/builtins/device-manager/claimed-status-overlay.d.ts +45 -0
- package/system/dist/builtins/device-manager/contribution-cache.d.ts +85 -0
- package/system/dist/builtins/device-manager/day-night-config-schema.d.ts +30 -0
- package/system/dist/builtins/device-manager/device-aggregation-merge.d.ts +22 -0
- package/system/dist/builtins/device-manager/device-aggregation.d.ts +335 -0
- package/system/dist/builtins/device-manager/device-bindings-store.d.ts +278 -0
- package/system/dist/builtins/device-manager/device-config-contribution.d.ts +45 -0
- package/system/dist/builtins/device-manager/device-config-secrets.d.ts +40 -0
- package/system/dist/builtins/device-manager/device-event-propagator.d.ts +26 -0
- package/system/dist/builtins/device-manager/device-extension-linked-slot.d.ts +27 -0
- package/system/dist/builtins/device-manager/device-form-secrets.d.ts +25 -0
- package/system/dist/builtins/device-manager/device-linked-devices.d.ts +201 -0
- package/system/dist/builtins/device-manager/device-manager.addon.d.ts +234 -0
- package/system/dist/builtins/device-manager/device-manager.addon.js +11369 -0
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +11358 -0
- package/system/dist/builtins/device-manager/device-meta-actions.d.ts +338 -0
- package/system/dist/builtins/device-manager/device-meta-store.d.ts +103 -0
- package/system/dist/builtins/device-manager/device-meta-types.d.ts +277 -0
- package/system/dist/builtins/device-manager/device-online-fallback.d.ts +35 -0
- package/system/dist/builtins/device-manager/device-projection.d.ts +71 -0
- package/system/dist/builtins/device-manager/device-provider-context.d.ts +126 -0
- package/system/dist/builtins/device-manager/device-queries.d.ts +67 -0
- package/system/dist/builtins/device-manager/device-removal-hooks.d.ts +92 -0
- package/system/dist/builtins/device-manager/device-row-store.d.ts +449 -0
- package/system/dist/builtins/device-manager/device-source-activation.d.ts +103 -0
- package/system/dist/builtins/device-manager/device-state-claim-views.d.ts +92 -0
- package/system/dist/builtins/device-manager/device-state-claims.d.ts +66 -0
- package/system/dist/builtins/device-manager/device-state-mirror.d.ts +267 -0
- package/system/dist/builtins/device-manager/device-sync-resolvers.d.ts +30 -0
- package/system/dist/builtins/device-manager/device-tombstone-store.d.ts +29 -0
- package/system/dist/builtins/device-manager/discovery-orchestrator.d.ts +45 -0
- package/system/dist/builtins/device-manager/field-claims-index.d.ts +96 -0
- package/system/dist/builtins/device-manager/field-ownership.d.ts +71 -0
- package/system/dist/builtins/device-manager/fleet-read-census.d.ts +104 -0
- package/system/dist/builtins/device-manager/image-settings-config-schema.d.ts +22 -0
- package/system/dist/builtins/device-manager/index.d.ts +2 -0
- package/system/dist/builtins/device-manager/index.js +8 -0
- package/system/dist/builtins/device-manager/index.mjs +2 -0
- package/system/dist/builtins/device-manager/linked-devices-manual-backfill.d.ts +27 -0
- package/system/dist/builtins/device-manager/location-alignment.d.ts +61 -0
- package/system/dist/builtins/device-manager/migrate-device.d.ts +192 -0
- package/system/dist/builtins/device-manager/migrate-guard.d.ts +78 -0
- package/system/dist/builtins/device-manager/migrate-hardware-state.d.ts +79 -0
- package/system/dist/builtins/device-manager/migrate-reload.d.ts +46 -0
- package/system/dist/builtins/device-manager/migration-refused.d.ts +23 -0
- package/system/dist/builtins/device-manager/mirror-row-writer.d.ts +222 -0
- package/system/dist/builtins/device-manager/record-kinds.d.ts +14 -0
- package/system/dist/builtins/device-manager/recording-onboard-config-schema.d.ts +65 -0
- package/system/dist/builtins/device-manager/removal-cleanup.d.ts +50 -0
- package/system/dist/builtins/device-manager/removal-fence.d.ts +58 -0
- package/system/dist/builtins/device-manager/running-flip.d.ts +11 -0
- package/system/dist/builtins/device-manager/runtime-state-persist-gate.d.ts +64 -0
- package/system/dist/builtins/device-manager/secret-config-paths.d.ts +24 -0
- package/system/dist/builtins/device-manager/stale-wrapper-activations.d.ts +59 -0
- package/system/dist/builtins/device-manager/write-lock.d.ts +17 -0
- package/system/dist/builtins/hub-forwarder/hub-forwarder-destination.d.ts +43 -0
- package/system/dist/builtins/hub-forwarder/hub-forwarder.addon.d.ts +16 -0
- package/system/dist/builtins/hub-forwarder/index.d.ts +3 -0
- package/system/dist/builtins/hub-forwarder/index.js +151 -0
- package/system/dist/builtins/hub-forwarder/index.mjs +142 -0
- package/system/dist/builtins/keychain/index.d.ts +1 -0
- package/system/dist/builtins/keychain/index.js +2059 -0
- package/system/dist/builtins/keychain/index.mjs +2052 -0
- package/system/dist/builtins/keychain/key-sources.d.ts +37 -0
- package/system/dist/builtins/keychain/keychain-crypto.d.ts +28 -0
- package/system/dist/builtins/keychain/keychain-reset-trigger.d.ts +25 -0
- package/system/dist/builtins/keychain/keychain-service.d.ts +180 -0
- package/system/dist/builtins/keychain/keychain-store.d.ts +125 -0
- package/system/dist/builtins/keychain/keychain-usage.d.ts +17 -0
- package/system/dist/builtins/keychain/keychain.addon.d.ts +36 -0
- package/system/dist/builtins/keychain/platform-key-source.d.ts +24 -0
- package/system/dist/builtins/keychain/record-kinds.d.ts +16 -0
- package/system/dist/builtins/keychain/system-held-secrets.d.ts +25 -0
- package/system/dist/builtins/liveness-monitor/index.d.ts +2 -0
- package/system/dist/builtins/liveness-monitor/index.js +6 -0
- package/system/dist/builtins/liveness-monitor/index.mjs +2 -0
- package/system/dist/builtins/liveness-monitor/liveness-checks.d.ts +85 -0
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.d.ts +46 -0
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +443 -0
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +437 -0
- package/system/dist/builtins/liveness-monitor/liveness-reporter.d.ts +28 -0
- package/system/dist/builtins/liveness-monitor/storage-root-access.d.ts +53 -0
- package/system/dist/builtins/local-auth/admin-account-boot.d.ts +27 -0
- package/system/dist/builtins/local-auth/auth-config-reader.d.ts +39 -0
- package/system/dist/builtins/local-auth/auth-schema.d.ts +93 -0
- package/system/dist/builtins/local-auth/index.d.ts +1 -0
- package/system/dist/builtins/local-auth/index.js +4 -0
- package/system/dist/builtins/local-auth/index.mjs +2 -0
- package/system/dist/builtins/local-auth/jwt-signing-key-keeper.d.ts +30 -0
- package/system/dist/builtins/local-auth/local-auth.addon.d.ts +48 -0
- package/system/dist/builtins/local-auth/local-auth.addon.js +12418 -0
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +12388 -0
- package/system/dist/builtins/local-auth/oauth-grants.d.ts +71 -0
- package/system/dist/builtins/local-auth/oauth-session-manager.d.ts +44 -0
- package/system/dist/builtins/local-auth/person-scopes.d.ts +7 -0
- package/system/dist/builtins/local-auth/preferences-record-kinds.d.ts +27 -0
- package/system/dist/builtins/local-auth/record-kinds.d.ts +137 -0
- package/system/dist/builtins/local-auth/user-preferences-store.d.ts +56 -0
- package/system/dist/builtins/local-network/address-book.d.ts +128 -0
- package/system/dist/builtins/local-network/agent-mdns.d.ts +56 -0
- package/system/dist/builtins/local-network/hub-mdns-ciao.d.ts +7 -0
- package/system/dist/builtins/local-network/hub-mdns.d.ts +58 -0
- package/system/dist/builtins/local-network/index.d.ts +1 -0
- package/system/dist/builtins/local-network/index.js +10 -0
- package/system/dist/builtins/local-network/index.mjs +2 -0
- package/system/dist/builtins/local-network/ipv6-lan.d.ts +21 -0
- package/system/dist/builtins/local-network/local-hostname.d.ts +15 -0
- package/system/dist/builtins/local-network/local-network.addon.d.ts +334 -0
- package/system/dist/builtins/local-network/local-network.addon.js +2487 -0
- package/system/dist/builtins/local-network/local-network.addon.mjs +2466 -0
- package/system/dist/builtins/local-network/scan/dns-wire.d.ts +17 -0
- package/system/dist/builtins/local-network/scan/scan-engine.d.ts +31 -0
- package/system/dist/builtins/local-network/scan/scan-io-node.d.ts +2 -0
- package/system/dist/builtins/local-network/scan/scan-io.d.ts +56 -0
- package/system/dist/builtins/local-network/scan/subnets.d.ts +57 -0
- package/system/dist/builtins/loki-logging/index.d.ts +4 -0
- package/system/dist/builtins/loki-logging/index.js +915 -0
- package/system/dist/builtins/loki-logging/index.mjs +901 -0
- package/system/dist/builtins/loki-logging/loki-destination.d.ts +142 -0
- package/system/dist/builtins/loki-logging/loki-logging.addon.d.ts +66 -0
- package/system/dist/builtins/loki-logging/loki-payload.d.ts +100 -0
- package/system/dist/builtins/loki-logging/loki-read.d.ts +51 -0
- package/system/dist/builtins/loki-logging/retire-enabled-flag.d.ts +48 -0
- package/system/dist/builtins/native-metrics/cgroup-memory.d.ts +240 -0
- package/system/dist/builtins/native-metrics/cgroup-pids.d.ts +159 -0
- package/system/dist/builtins/native-metrics/container-memory-ring.d.ts +18 -0
- package/system/dist/builtins/native-metrics/darwin-memory.d.ts +26 -0
- package/system/dist/builtins/native-metrics/gpu-probe.d.ts +18 -0
- package/system/dist/builtins/native-metrics/index.d.ts +2 -0
- package/system/dist/builtins/native-metrics/load-series-config.d.ts +83 -0
- package/system/dist/builtins/native-metrics/load-series-reader.d.ts +63 -0
- package/system/dist/builtins/native-metrics/load-series-types.d.ts +14 -0
- package/system/dist/builtins/native-metrics/native-metrics-provider.d.ts +49 -0
- package/system/dist/builtins/native-metrics/native-metrics.addon.d.ts +233 -0
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +3116 -0
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +3106 -0
- package/system/dist/builtins/native-metrics/node-load-ring.d.ts +212 -0
- package/system/dist/builtins/native-metrics/node-metrics-history-recorder.d.ts +155 -0
- package/system/dist/builtins/native-metrics/proc-process-table.d.ts +25 -0
- package/system/dist/builtins/native-metrics/process-classification.d.ts +110 -0
- package/system/dist/builtins/native-metrics/thread-cpu-sampler.d.ts +116 -0
- package/system/dist/builtins/platform-probe/accelerator-facts-probe.d.ts +24 -0
- package/system/dist/builtins/platform-probe/accelerator-reprobe.d.ts +23 -0
- package/system/dist/builtins/platform-probe/amd-accelerators.d.ts +15 -0
- package/system/dist/builtins/platform-probe/amd-npu.d.ts +35 -0
- package/system/dist/builtins/platform-probe/coral-accelerators.d.ts +87 -0
- package/system/dist/builtins/platform-probe/index.d.ts +57 -0
- package/system/dist/builtins/platform-probe/index.js +1151 -0
- package/system/dist/builtins/platform-probe/index.mjs +1140 -0
- package/system/dist/builtins/platform-probe/inference-config-resolver.d.ts +29 -0
- package/system/dist/builtins/platform-probe/intel-accelerators.d.ts +14 -0
- package/system/dist/builtins/platform-probe/intel-npu.d.ts +38 -0
- package/system/dist/builtins/platform-probe/platform-scorer.d.ts +66 -0
- package/system/dist/builtins/platform-probe/runtime-packages.d.ts +6 -0
- package/system/dist/builtins/platform-probe/windows-hardware.d.ts +77 -0
- package/system/dist/builtins/record-entries/entries-service.d.ts +42 -0
- package/system/dist/builtins/record-entries/index.d.ts +1 -0
- package/system/dist/builtins/record-entries/index.js +162 -0
- package/system/dist/builtins/record-entries/index.mjs +156 -0
- package/system/dist/builtins/record-entries/record-entries.addon.d.ts +13 -0
- package/system/dist/builtins/records-isolated.d.ts +10 -0
- package/system/dist/builtins/remote-access-orchestrator/enabled-providers-reconcile.d.ts +96 -0
- package/system/dist/builtins/remote-access-orchestrator/index.d.ts +1 -0
- package/system/dist/builtins/remote-access-orchestrator/index.js +8 -0
- package/system/dist/builtins/remote-access-orchestrator/index.mjs +2 -0
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.d.ts +71 -0
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +214 -0
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +208 -0
- package/system/dist/builtins/shared/device-state-changed.d.ts +16 -0
- package/system/dist/builtins/shared/settle-sources.d.ts +22 -0
- package/system/dist/builtins/snapshot/index.d.ts +2 -0
- package/system/dist/builtins/snapshot/index.js +2720 -0
- package/system/dist/builtins/snapshot/index.mjs +2713 -0
- package/system/dist/builtins/snapshot/snapshot-cache.d.ts +108 -0
- package/system/dist/builtins/snapshot/snapshot-coalescing.d.ts +135 -0
- package/system/dist/builtins/snapshot/snapshot-courtesy.d.ts +68 -0
- package/system/dist/builtins/snapshot/snapshot-durable-store.d.ts +36 -0
- package/system/dist/builtins/snapshot/snapshot-fatigue.d.ts +41 -0
- package/system/dist/builtins/snapshot/snapshot-grab-pick.d.ts +20 -0
- package/system/dist/builtins/snapshot/snapshot-link-url.d.ts +66 -0
- package/system/dist/builtins/snapshot/snapshot-media-handler.d.ts +121 -0
- package/system/dist/builtins/snapshot/snapshot-resize.d.ts +75 -0
- package/system/dist/builtins/snapshot/snapshot.addon.d.ts +581 -0
- package/system/dist/builtins/sqlite-storage/analyze-stats.d.ts +83 -0
- package/system/dist/builtins/sqlite-storage/config-store.d.ts +8 -0
- package/system/dist/builtins/sqlite-storage/database-snapshot-provider.d.ts +18 -0
- package/system/dist/builtins/sqlite-storage/device-store.d.ts +23 -0
- package/system/dist/builtins/sqlite-storage/file-host-client.d.ts +75 -0
- package/system/dist/builtins/sqlite-storage/file-host-handlers.d.ts +27 -0
- package/system/dist/builtins/sqlite-storage/file-host-protocol.d.ts +167 -0
- package/system/dist/builtins/sqlite-storage/file-host-worker.d.ts +1 -0
- package/system/dist/builtins/sqlite-storage/filesystem-browse-provider.d.ts +25 -0
- package/system/dist/builtins/sqlite-storage/filesystem-storage-provider.d.ts +83 -0
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.d.ts +33 -0
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +419 -0
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +411 -0
- package/system/dist/builtins/sqlite-storage/filter-compiler.d.ts +126 -0
- package/system/dist/builtins/sqlite-storage/index.d.ts +12 -0
- package/system/dist/builtins/sqlite-storage/index.js +82 -0
- package/system/dist/builtins/sqlite-storage/index.mjs +50 -0
- package/system/dist/builtins/sqlite-storage/integration-record-kinds.d.ts +31 -0
- package/system/dist/builtins/sqlite-storage/integration-registry.d.ts +34 -0
- package/system/dist/builtins/sqlite-storage/migrations/migration-actions.d.ts +12 -0
- package/system/dist/builtins/sqlite-storage/migrations/migration-edits.d.ts +35 -0
- package/system/dist/builtins/sqlite-storage/migrations/migration-engine.d.ts +125 -0
- package/system/dist/builtins/sqlite-storage/migrations/migration-hold.d.ts +23 -0
- package/system/dist/builtins/sqlite-storage/migrations/migration-pass.d.ts +48 -0
- package/system/dist/builtins/sqlite-storage/migrations/migration-restore-marker.d.ts +3 -0
- package/system/dist/builtins/sqlite-storage/migrations/migration-types.d.ts +151 -0
- package/system/dist/builtins/sqlite-storage/migrations/migrations-provider.d.ts +61 -0
- package/system/dist/builtins/sqlite-storage/owned-sqlite-file.d.ts +173 -0
- package/system/dist/builtins/sqlite-storage/path-guard.d.ts +11 -0
- package/system/dist/builtins/sqlite-storage/placement-errors.d.ts +60 -0
- package/system/dist/builtins/sqlite-storage/placement-router.d.ts +85 -0
- package/system/dist/builtins/sqlite-storage/prefix-range.d.ts +50 -0
- package/system/dist/builtins/sqlite-storage/query-bounds.d.ts +110 -0
- package/system/dist/builtins/sqlite-storage/query-profiler.d.ts +242 -0
- package/system/dist/builtins/sqlite-storage/records/records-catalog.d.ts +27 -0
- package/system/dist/builtins/sqlite-storage/records/records-engine-types.d.ts +48 -0
- package/system/dist/builtins/sqlite-storage/records/records-engine.d.ts +115 -0
- package/system/dist/builtins/sqlite-storage/records/records-explain.d.ts +18 -0
- package/system/dist/builtins/sqlite-storage/records/records-plan.d.ts +95 -0
- package/system/dist/builtins/sqlite-storage/records/records-probe.d.ts +33 -0
- package/system/dist/builtins/sqlite-storage/records/records-provider.d.ts +72 -0
- package/system/dist/builtins/sqlite-storage/records/records-rows.d.ts +46 -0
- package/system/dist/builtins/sqlite-storage/records/records-sql.d.ts +39 -0
- package/system/dist/builtins/sqlite-storage/retired-settings-keys.d.ts +276 -0
- package/system/dist/builtins/sqlite-storage/shm-lock-canary.d.ts +60 -0
- package/system/dist/builtins/sqlite-storage/sqlite-pragmas.d.ts +191 -0
- package/system/dist/builtins/sqlite-storage/sqlite-settings-backend.d.ts +583 -0
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.d.ts +52 -0
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +2960 -0
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +2952 -0
- package/system/dist/builtins/sqlite-storage/sqlite-snapshot-protocol.d.ts +54 -0
- package/system/dist/builtins/sqlite-storage/sqlite-snapshot-worker.d.ts +33 -0
- package/system/dist/builtins/sqlite-storage/sqlite-snapshotter.d.ts +118 -0
- package/system/dist/builtins/sqlite-storage/stale-data/stale-data-audit.d.ts +81 -0
- package/system/dist/builtins/sqlite-storage/stale-data/stale-data-ports.d.ts +17 -0
- package/system/dist/builtins/sqlite-storage/statement-shape.d.ts +64 -0
- package/system/dist/builtins/sqlite-storage/storage-admin-provider.d.ts +33 -0
- package/system/dist/builtins/sqlite-storage/table-sizes.d.ts +95 -0
- package/system/dist/builtins/sqlite-storage/vector-index-shared.d.ts +81 -0
- package/system/dist/builtins/sqlite-storage/vector-index-vec.d.ts +143 -0
- package/system/dist/builtins/sqlite-storage/vector-provider.d.ts +30 -0
- package/system/dist/builtins/sqlite-storage/wal-checkpoint-policy.d.ts +196 -0
- package/system/dist/builtins/sqlite-storage/wal-checkpoint-worker.d.ts +1 -0
- package/system/dist/builtins/sqlite-storage/wal-checkpointer.d.ts +76 -0
- package/system/dist/builtins/sqlite-storage/wal-maintenance.d.ts +130 -0
- package/system/dist/builtins/storage-orchestrator/access-guards.d.ts +43 -0
- package/system/dist/builtins/storage-orchestrator/data-store-dispatch.d.ts +39 -0
- package/system/dist/builtins/storage-orchestrator/drain-ratchet.d.ts +104 -0
- package/system/dist/builtins/storage-orchestrator/drain-state-store.d.ts +26 -0
- package/system/dist/builtins/storage-orchestrator/hub-settings-forward.d.ts +128 -0
- package/system/dist/builtins/storage-orchestrator/index.d.ts +7 -0
- package/system/dist/builtins/storage-orchestrator/index.js +11 -0
- package/system/dist/builtins/storage-orchestrator/index.mjs +2 -0
- package/system/dist/builtins/storage-orchestrator/location-class-paths.d.ts +13 -0
- package/system/dist/builtins/storage-orchestrator/location-history-recorder.d.ts +76 -0
- package/system/dist/builtins/storage-orchestrator/location-occupancy-slice.d.ts +71 -0
- package/system/dist/builtins/storage-orchestrator/location-occupancy.d.ts +19 -0
- package/system/dist/builtins/storage-orchestrator/location-protection.d.ts +20 -0
- package/system/dist/builtins/storage-orchestrator/location-repoint-move.d.ts +57 -0
- package/system/dist/builtins/storage-orchestrator/location-repointer.d.ts +97 -0
- package/system/dist/builtins/storage-orchestrator/location-root-collision.d.ts +80 -0
- package/system/dist/builtins/storage-orchestrator/location-secrets.d.ts +114 -0
- package/system/dist/builtins/storage-orchestrator/location-store.d.ts +82 -0
- package/system/dist/builtins/storage-orchestrator/location-volume-capacity.d.ts +58 -0
- package/system/dist/builtins/storage-orchestrator/provider-discovery.d.ts +24 -0
- package/system/dist/builtins/storage-orchestrator/record-kinds.d.ts +43 -0
- package/system/dist/builtins/storage-orchestrator/storage-cleanup-coordinator.d.ts +68 -0
- package/system/dist/builtins/storage-orchestrator/storage-location-band-monitor.d.ts +77 -0
- package/system/dist/builtins/storage-orchestrator/storage-migration-coordinator.d.ts +241 -0
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.d.ts +318 -0
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +5280 -0
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +5264 -0
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.service.d.ts +475 -0
- package/system/dist/builtins/storage-orchestrator/storage-pressure-manager.d.ts +115 -0
- package/system/dist/builtins/system-backup/backup-encryption.d.ts +94 -0
- package/system/dist/builtins/system-backup/system-backup.service.d.ts +308 -0
- package/system/dist/builtins/system-config/index.d.ts +2 -0
- package/system/dist/builtins/system-config/index.js +10 -0
- package/system/dist/builtins/system-config/index.mjs +2 -0
- package/system/dist/builtins/system-config/mesh-actions.d.ts +3 -0
- package/system/dist/builtins/system-config/record-kinds.d.ts +32 -0
- package/system/dist/builtins/system-config/system-config.addon.d.ts +56 -0
- package/system/dist/builtins/system-config/system-config.addon.js +89334 -0
- package/system/dist/builtins/system-config/system-config.addon.mjs +89233 -0
- package/system/dist/builtins/winston-logging/index.d.ts +3 -0
- package/system/dist/builtins/winston-logging/index.js +324 -0
- package/system/dist/builtins/winston-logging/index.mjs +313 -0
- package/system/dist/builtins/winston-logging/log-file-cursor.d.ts +12 -0
- package/system/dist/builtins/winston-logging/log-file-index-store.d.ts +11 -0
- package/system/dist/builtins/winston-logging/log-file-index.d.ts +77 -0
- package/system/dist/builtins/winston-logging/log-file-read-client.d.ts +44 -0
- package/system/dist/builtins/winston-logging/log-file-read-protocol.d.ts +41 -0
- package/system/dist/builtins/winston-logging/log-file-read-worker.d.ts +1 -0
- package/system/dist/builtins/winston-logging/log-file-reader.d.ts +51 -0
- package/system/dist/builtins/winston-logging/winston-destination.d.ts +39 -0
- package/system/dist/builtins/winston-logging/winston-logging.addon.d.ts +20 -0
- package/system/dist/chunk-CNf5ZN-e.mjs +37 -0
- package/system/dist/chunk-Cek0wNdY.js +64 -0
- package/system/dist/composition-sources-C14epb_m.js +155 -0
- package/system/dist/composition-sources-EXNuxmGQ.mjs +132 -0
- package/system/dist/constants-DIGWBiNC.mjs +20 -0
- package/system/dist/constants-M7NtSiRo.js +66 -0
- package/system/dist/coral-accelerators-BSVsBVzt.js +250 -0
- package/system/dist/coral-accelerators-DBlgWB8k.mjs +231 -0
- package/system/dist/custom-action-registry-JuMHGKEc.js +1638 -0
- package/system/dist/custom-action-registry-oHl1xltx.mjs +1482 -0
- package/system/dist/device-ca-3vmBP1i0.js +474 -0
- package/system/dist/device-ca-DZlvNBWU.mjs +367 -0
- package/system/dist/dist-DcMqHB_N.mjs +108095 -0
- package/system/dist/dist-M9yHiIY7.js +110554 -0
- package/system/dist/download/hosted-model-revisions.d.ts +10 -0
- package/system/dist/download/model-download-service.d.ts +35 -0
- package/system/dist/download/model-downloader.d.ts +156 -0
- package/system/dist/events/event-bus.d.ts +10 -0
- package/system/dist/events/system-event-bus.d.ts +14 -0
- package/system/dist/feature/feature-manager.d.ts +11 -0
- package/system/dist/file-host-worker.js +160 -0
- package/system/dist/file-host-worker.mjs +160 -0
- package/system/dist/formatter-DkYZ4LXp.mjs +162 -0
- package/system/dist/formatter-xbxeV4GD.js +167 -0
- package/system/dist/framework-resolver-hook.mjs +49 -0
- package/system/dist/http/asset-compression.d.ts +55 -0
- package/system/dist/http/authenticated-file-server.d.ts +53 -0
- package/system/dist/http/data-plane-registry.d.ts +58 -0
- package/system/dist/http/file-data-plane.d.ts +18 -0
- package/system/dist/http/lan-http-bind.d.ts +41 -0
- package/system/dist/http/reverse-proxy.d.ts +42 -0
- package/system/dist/hub-mdns-ciao-CpCKuQnK.js +1163 -0
- package/system/dist/hub-mdns-ciao-Czz2ssit.mjs +942 -0
- package/system/dist/i18n/catalog-registry.d.ts +35 -0
- package/system/dist/i18n/index.d.ts +2 -0
- package/system/dist/index.d.ts +156 -0
- package/system/dist/index.js +28736 -0
- package/system/dist/index.mjs +28065 -0
- package/system/dist/intel-accelerators-BvBjZn4j.js +16 -0
- package/system/dist/intel-accelerators-idEumqk1.mjs +15 -0
- package/system/dist/intel-npu-C8HKvRQF.mjs +27 -0
- package/system/dist/intel-npu-DYF5hO5K.js +28 -0
- package/system/dist/kernel/addon-class-resolver.d.ts +4 -0
- package/system/dist/kernel/addon-engine-manager.d.ts +22 -0
- package/system/dist/kernel/addon-health-monitor.d.ts +163 -0
- package/system/dist/kernel/addon-installer.d.ts +651 -0
- package/system/dist/kernel/addon-loader.d.ts +144 -0
- package/system/dist/kernel/addon-manifest.d.ts +128 -0
- package/system/dist/kernel/addon-refused-error.d.ts +30 -0
- package/system/dist/kernel/addon-residue.d.ts +45 -0
- package/system/dist/kernel/addon-settings-store.d.ts +43 -0
- package/system/dist/kernel/addon-version-policy.d.ts +34 -0
- package/system/dist/kernel/anon-rss.d.ts +12 -0
- package/system/dist/kernel/array-buffer-census.d.ts +118 -0
- package/system/dist/kernel/bootstrap-config.d.ts +7 -0
- package/system/dist/kernel/cap-router-builder.d.ts +180 -0
- package/system/dist/kernel/capability-handle.d.ts +46 -0
- package/system/dist/kernel/capability-registry.d.ts +621 -0
- package/system/dist/kernel/config-manager.d.ts +174 -0
- package/system/dist/kernel/config-schema.d.ts +37 -0
- package/system/dist/kernel/custom-action-registry.d.ts +32 -0
- package/system/dist/kernel/deps/addon-deps-manager.d.ts +28 -0
- package/system/dist/kernel/deps/closure-dedupe.d.ts +105 -0
- package/system/dist/kernel/deps/ensure-addon-natives.d.ts +41 -0
- package/system/dist/kernel/deps/ensure-native-prebuilds.d.ts +40 -0
- package/system/dist/kernel/deps/manifest-native-deps.d.ts +42 -0
- package/system/dist/kernel/deps/manifest-python-deps.d.ts +20 -0
- package/system/dist/kernel/deps/manifest-system-deps.d.ts +18 -0
- package/system/dist/kernel/deps/npm-command.d.ts +60 -0
- package/system/dist/kernel/deps/system-package-allowlist.d.ts +12 -0
- package/system/dist/kernel/deps/system-package-broker.d.ts +31 -0
- package/system/dist/kernel/deps/system-package-client.d.ts +9 -0
- package/system/dist/kernel/device-call-redirect.d.ts +18 -0
- package/system/dist/kernel/device-registry.d.ts +29 -0
- package/system/dist/kernel/device-settings-store.d.ts +74 -0
- package/system/dist/kernel/event-loop-stall-monitor.d.ts +41 -0
- package/system/dist/kernel/event-plane-report.d.ts +225 -0
- package/system/dist/kernel/fs-utils.d.ts +88 -0
- package/system/dist/kernel/gc-census.d.ts +161 -0
- package/system/dist/kernel/heap-spaces.d.ts +112 -0
- package/system/dist/kernel/heap-watch.d.ts +816 -0
- package/system/dist/kernel/host-externals.d.ts +12 -0
- package/system/dist/kernel/hwaccel/hwaccel-resolver.d.ts +56 -0
- package/system/dist/kernel/hwaccel/vaapi-init-probe.d.ts +29 -0
- package/system/dist/kernel/index.d.ts +116 -0
- package/system/dist/kernel/inference/inference-resolver.d.ts +22 -0
- package/system/dist/kernel/inference/local-python-runtimes.d.ts +2 -0
- package/system/dist/kernel/infra-capabilities.d.ts +13 -0
- package/system/dist/kernel/isolated-builtin-phase.d.ts +57 -0
- package/system/dist/kernel/lifecycle/job-journal.d.ts +19 -0
- package/system/dist/kernel/lifecycle/lifecycle-job-engine.d.ts +106 -0
- package/system/dist/kernel/lifecycle/staging-area.d.ts +31 -0
- package/system/dist/kernel/moleculer/accessory-prune-gate.d.ts +55 -0
- package/system/dist/kernel/moleculer/addon-context-factory.d.ts +104 -0
- package/system/dist/kernel/moleculer/addon-data-plane-facility.d.ts +19 -0
- package/system/dist/kernel/moleculer/addon-deploy-source.d.ts +16 -0
- package/system/dist/kernel/moleculer/addon-peer-bytes-facility.d.ts +25 -0
- package/system/dist/kernel/moleculer/addon-runner.d.ts +1 -0
- package/system/dist/kernel/moleculer/addon-service-factory.d.ts +50 -0
- package/system/dist/kernel/moleculer/agent-event-scope.d.ts +49 -0
- package/system/dist/kernel/moleculer/agent-ui-unlock.d.ts +67 -0
- package/system/dist/kernel/moleculer/broker-factory.d.ts +95 -0
- package/system/dist/kernel/moleculer/broker-transport-swap.d.ts +60 -0
- package/system/dist/kernel/moleculer/cap-usage-registry.d.ts +126 -0
- package/system/dist/kernel/moleculer/capabilities-access.d.ts +21 -0
- package/system/dist/kernel/moleculer/child-addon-call-dispatch.d.ts +53 -0
- package/system/dist/kernel/moleculer/child-cap-descriptors.d.ts +34 -0
- package/system/dist/kernel/moleculer/child-cap-dispatch.d.ts +59 -0
- package/system/dist/kernel/moleculer/children-batch-loader.d.ts +98 -0
- package/system/dist/kernel/moleculer/core-cap-service.d.ts +65 -0
- package/system/dist/kernel/moleculer/crash-supervisor.d.ts +50 -0
- package/system/dist/kernel/moleculer/device-cap-proxy.d.ts +70 -0
- package/system/dist/kernel/moleculer/device-event-ring.d.ts +155 -0
- package/system/dist/kernel/moleculer/event-bus-core.d.ts +198 -0
- package/system/dist/kernel/moleculer/event-bus.d.ts +106 -0
- package/system/dist/kernel/moleculer/hub-log-forwarder.d.ts +36 -0
- package/system/dist/kernel/moleculer/hub-service.d.ts +39 -0
- package/system/dist/kernel/moleculer/init-watchdog.d.ts +60 -0
- package/system/dist/kernel/moleculer/mesh-access-middleware.d.ts +42 -0
- package/system/dist/kernel/moleculer/mesh-identity.d.ts +57 -0
- package/system/dist/kernel/moleculer/mesh-mtls/constants.d.ts +17 -0
- package/system/dist/kernel/moleculer/mesh-mtls/index.d.ts +12 -0
- package/system/dist/kernel/moleculer/mesh-mtls/mesh-ca-keeper.d.ts +60 -0
- package/system/dist/kernel/moleculer/mesh-mtls/mesh-ca.d.ts +49 -0
- package/system/dist/kernel/moleculer/mesh-mtls/mesh-certificate-registry.d.ts +105 -0
- package/system/dist/kernel/moleculer/mesh-mtls/mesh-crl.d.ts +16 -0
- package/system/dist/kernel/moleculer/mesh-mtls/mesh-membership.d.ts +64 -0
- package/system/dist/kernel/moleculer/mesh-mtls/mesh-peer-transport.d.ts +47 -0
- package/system/dist/kernel/moleculer/mesh-mtls/mesh-renewal.d.ts +135 -0
- package/system/dist/kernel/moleculer/mesh-mtls/mesh-tls-enabler.d.ts +9 -0
- package/system/dist/kernel/moleculer/mesh-mtls/mesh-tls-gate.d.ts +40 -0
- package/system/dist/kernel/moleculer/mesh-mtls/pairing/agent-pairing.d.ts +214 -0
- package/system/dist/kernel/moleculer/mesh-mtls/pairing/hub-pairing.d.ts +115 -0
- package/system/dist/kernel/moleculer/mesh-mtls/pairing/index.d.ts +3 -0
- package/system/dist/kernel/moleculer/mesh-mtls/pairing/pairing-protocol.d.ts +107 -0
- package/system/dist/kernel/moleculer/mesh-mtls/tls-tcp-transporter.d.ts +242 -0
- package/system/dist/kernel/moleculer/mesh-queue-report.d.ts +51 -0
- package/system/dist/kernel/moleculer/node-registry.d.ts +146 -0
- package/system/dist/kernel/moleculer/process-context.d.ts +4 -0
- package/system/dist/kernel/moleculer/process-service.d.ts +92 -0
- package/system/dist/kernel/moleculer/provider-registry.d.ts +28 -0
- package/system/dist/kernel/moleculer/readiness-context.d.ts +67 -0
- package/system/dist/kernel/moleculer/readiness-service.d.ts +37 -0
- package/system/dist/kernel/moleculer/records-api-transport.d.ts +9 -0
- package/system/dist/kernel/moleculer/register-framework-resolver.d.ts +8 -0
- package/system/dist/kernel/moleculer/register-node-client.d.ts +49 -0
- package/system/dist/kernel/moleculer/remote-logger.d.ts +43 -0
- package/system/dist/kernel/moleculer/resilient-cap-call.d.ts +28 -0
- package/system/dist/kernel/moleculer/runner-addon-settings.d.ts +29 -0
- package/system/dist/kernel/moleculer/runner-device-settings.d.ts +39 -0
- package/system/dist/kernel/moleculer/runner-heap-flags.d.ts +228 -0
- package/system/dist/kernel/moleculer/runner-native-allocator.d.ts +107 -0
- package/system/dist/kernel/moleculer/runner-process-group.d.ts +96 -0
- package/system/dist/kernel/moleculer/runner-refusal.d.ts +27 -0
- package/system/dist/kernel/moleculer/runtime-state-load.d.ts +29 -0
- package/system/dist/kernel/moleculer/settings-read-guard.d.ts +49 -0
- package/system/dist/kernel/moleculer/stream-probe-service.d.ts +28 -0
- package/system/dist/kernel/moleculer/trpc-links.d.ts +244 -0
- package/system/dist/kernel/moleculer/typed-array-serde.d.ts +14 -0
- package/system/dist/kernel/moleculer/worker-device-restore.d.ts +10 -0
- package/system/dist/kernel/outbound-queue-watch.d.ts +94 -0
- package/system/dist/kernel/prefix-walk.d.ts +39 -0
- package/system/dist/kernel/process-cpu-census.d.ts +74 -0
- package/system/dist/kernel/provider-kind-drift.d.ts +21 -0
- package/system/dist/kernel/restart-coordinator.d.ts +90 -0
- package/system/dist/kernel/sections-store.d.ts +20 -0
- package/system/dist/kernel/settings-door-view.d.ts +41 -0
- package/system/dist/kernel/settings-read-error.d.ts +35 -0
- package/system/dist/kernel/settings-view-types.d.ts +80 -0
- package/system/dist/kernel/socket-plane-report.d.ts +268 -0
- package/system/dist/kernel/status-overlay.d.ts +38 -0
- package/system/dist/kernel/storage-location-registry.d.ts +55 -0
- package/system/dist/kernel/store-settings-view.d.ts +14 -0
- package/system/dist/kernel/system-settings-mirror.d.ts +46 -0
- package/system/dist/kernel/system-settings-policy.d.ts +28 -0
- package/system/dist/kernel/transport/cap-action-census.d.ts +218 -0
- package/system/dist/kernel/transport/cap-action-name.d.ts +100 -0
- package/system/dist/kernel/transport/cap-child-index.d.ts +49 -0
- package/system/dist/kernel/transport/cap-route-resolver.d.ts +231 -0
- package/system/dist/kernel/transport/cap-route.d.ts +168 -0
- package/system/dist/kernel/transport/cap-routing-hints.d.ts +42 -0
- package/system/dist/kernel/transport/child-cap-protocol.d.ts +307 -0
- package/system/dist/kernel/transport/claimed-get-status.d.ts +39 -0
- package/system/dist/kernel/transport/create-local-transport.d.ts +7 -0
- package/system/dist/kernel/transport/device-call-redirect.d.ts +39 -0
- package/system/dist/kernel/transport/frame-codec.d.ts +122 -0
- package/system/dist/kernel/transport/hub-cap-forward.d.ts +96 -0
- package/system/dist/kernel/transport/index.d.ts +38 -0
- package/system/dist/kernel/transport/local-child-client.d.ts +199 -0
- package/system/dist/kernel/transport/local-child-registry.d.ts +654 -0
- package/system/dist/kernel/transport/local-endpoint-path.d.ts +6 -0
- package/system/dist/kernel/transport/local-transport.d.ts +122 -0
- package/system/dist/kernel/transport/parent-unowned-call.d.ts +283 -0
- package/system/dist/kernel/transport/peer-answered-error.d.ts +21 -0
- package/system/dist/kernel/transport/socket-channel.d.ts +116 -0
- package/system/dist/kernel/transport/socket-traffic.d.ts +118 -0
- package/system/dist/kernel/transport/uds-event-bridge.d.ts +85 -0
- package/system/dist/kernel/transport/uds-event-bus.d.ts +93 -0
- package/system/dist/kernel/transport/uds-local-transport.d.ts +18 -0
- package/system/dist/kernel/transport/uds-log-ingest.d.ts +43 -0
- package/system/dist/kernel/transport/uds-logger.d.ts +44 -0
- package/system/dist/kernel/utils/ring-buffer.d.ts +15 -0
- package/system/dist/kernel/workspace-detect.d.ts +9 -0
- package/system/dist/lib-5THG9eKz.mjs +15545 -0
- package/system/dist/lib-C3U1yluo.js +7110 -0
- package/system/dist/lib-CZ3g2WTS.js +15549 -0
- package/system/dist/lib-DFZblCIu.mjs +7106 -0
- package/system/dist/lifecycle/lifecycle-state-machine.d.ts +28 -0
- package/system/dist/log-file-read-protocol-B7M3X3bT.mjs +785 -0
- package/system/dist/log-file-read-protocol-D0WcLbIV.js +817 -0
- package/system/dist/log-file-read-worker.js +64 -0
- package/system/dist/log-file-read-worker.mjs +64 -0
- package/system/dist/log-read-filter-Bi066jwU.js +134 -0
- package/system/dist/log-read-filter-D7Ev3zm-.mjs +93 -0
- package/system/dist/logging/formatter.d.ts +57 -0
- package/system/dist/logging/log-manager.d.ts +145 -0
- package/system/dist/logging/log-read-filter.d.ts +43 -0
- package/system/dist/logging/log-redactor.d.ts +30 -0
- package/system/dist/logging/log-ring-buffer.d.ts +62 -0
- package/system/dist/logging/logging-gate.d.ts +76 -0
- package/system/dist/logging/logging-gate.singleton.d.ts +16 -0
- package/system/dist/logging/partitioned-log-buffer.d.ts +169 -0
- package/system/dist/logging/scoped-logger.d.ts +17 -0
- package/system/dist/migrations/hub/index.d.ts +11 -0
- package/system/dist/ms-CgH2OFlD.mjs +120 -0
- package/system/dist/ms-LB3giGoU.js +124 -0
- package/system/dist/network/network-quality.d.ts +11 -0
- package/system/dist/notification/notification-service.d.ts +43 -0
- package/system/dist/notification/toast-service.d.ts +22 -0
- package/system/dist/pipeline/engine-manager-resolver.d.ts +15 -0
- package/system/dist/pipeline/pipeline-runner.d.ts +8 -0
- package/system/dist/pipeline/pipeline-validator.d.ts +13 -0
- package/system/dist/platform-key-source-BWlq0jjn.mjs +23 -0
- package/system/dist/platform-key-source-Di7HrlGR.js +40 -0
- package/system/dist/prefix-range-D_KueXbQ.js +27 -0
- package/system/dist/prefix-range-Dl0znowN.mjs +22 -0
- package/system/dist/prefix-walk-DAOBSyH1.mjs +88 -0
- package/system/dist/prefix-walk-Dv6MLZlM.js +99 -0
- package/system/dist/process/proc-stat.d.ts +75 -0
- package/system/dist/process/resource-monitor.d.ts +28 -0
- package/system/dist/python/python-env-manager.d.ts +12 -0
- package/system/dist/read-all-rows-CVoO1ONM.js +29 -0
- package/system/dist/read-all-rows-TaPqdWNF.mjs +25 -0
- package/system/dist/records/read-all-rows.d.ts +6 -0
- package/system/dist/repl/interfaces.d.ts +31 -0
- package/system/dist/repl/repl-engine.d.ts +8 -0
- package/system/dist/resource-monitor-Di9daRwI.mjs +96 -0
- package/system/dist/resource-monitor-mio9dSCT.js +113 -0
- package/system/dist/restore-archive-Cy7jGqiD.js +4325 -0
- package/system/dist/restore-archive-DS4nvQ43.mjs +4213 -0
- package/system/dist/retention-Dqm_EiVq.mjs +893 -0
- package/system/dist/retention-Ufa2fci-.js +1024 -0
- package/system/dist/retired-settings-keys-C8nOOr5H.js +381 -0
- package/system/dist/retired-settings-keys-u6xQA6r7.mjs +364 -0
- package/system/dist/safe-buffer-B1OjL1I9.mjs +42 -0
- package/system/dist/safe-buffer-D3aoa-7X.js +46 -0
- package/system/dist/settle-sources-Bhsy57y-.js +38 -0
- package/system/dist/settle-sources-CDtNC8ub.mjs +33 -0
- package/system/dist/snapshot-courtesy-CyFs1M3I.mjs +167 -0
- package/system/dist/snapshot-courtesy-D_C5-nC0.js +192 -0
- package/system/dist/sqlite-snapshot-protocol-2QaTouWV.mjs +34 -0
- package/system/dist/sqlite-snapshot-protocol-B9OndqZv.js +51 -0
- package/system/dist/sqlite-snapshot-worker.js +185 -0
- package/system/dist/sqlite-snapshot-worker.mjs +179 -0
- package/system/dist/src-CnAqG6EF.js +714 -0
- package/system/dist/src-hG4grMU4.mjs +709 -0
- package/system/dist/storage/fs-storage-backend.d.ts +40 -0
- package/system/dist/storage/storage-location-manager.d.ts +23 -0
- package/system/dist/storage/storage-manager.d.ts +83 -0
- package/system/dist/tls/agent-https-names.d.ts +25 -0
- package/system/dist/tls/agent-https.d.ts +111 -0
- package/system/dist/tls/boot-tls.d.ts +35 -0
- package/system/dist/tls/cert-backdate.d.ts +10 -0
- package/system/dist/tls/cert-evaluation.d.ts +41 -0
- package/system/dist/tls/cert-identity.d.ts +60 -0
- package/system/dist/tls/cert-issue.d.ts +57 -0
- package/system/dist/tls/cert-manager.d.ts +124 -0
- package/system/dist/tls/cert-name-constraints.d.ts +53 -0
- package/system/dist/tls/cert-utc-time.d.ts +1 -0
- package/system/dist/tls/https-listener.d.ts +30 -0
- package/system/dist/tls/index.d.ts +12 -0
- package/system/dist/tls/tls-actions.d.ts +49 -0
- package/system/dist/tls/tls-status.d.ts +57 -0
- package/system/dist/tls/uploaded-cert.d.ts +46 -0
- package/system/dist/wal-checkpoint-policy-BahrTtyD.mjs +186 -0
- package/system/dist/wal-checkpoint-policy-d2z2qPqx.js +233 -0
- package/system/dist/wal-checkpoint-worker.js +144 -0
- package/system/dist/wal-checkpoint-worker.mjs +143 -0
- package/system/dist/wal-maintenance-BmugbgS7.js +0 -0
- package/system/dist/wal-maintenance-Bnb2QzYG.mjs +0 -0
- package/system/dist/x509.es-BRiJgOvu.mjs +11939 -0
- package/system/dist/x509.es-WtnRNyYS.js +12076 -0
- package/system/package.json +516 -0
|
@@ -0,0 +1,1559 @@
|
|
|
1
|
+
import { $t as alertEpisodeId, Go as defineRecordKinds, Ho as createEvent, Ms as EventCategory, Qa as BaseAddon, d as AlertSchema, en as alertEpisodePayload, js as errMsg, tn as alertsCapability, vr as isAlertEpisodeOpen, yr as isAlertEpisodeSeverity } from "../../dist-DcMqHB_N.mjs";
|
|
2
|
+
import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
|
|
3
|
+
//#region src/builtins/alerts/alert-episode-policy.ts
|
|
4
|
+
/**
|
|
5
|
+
* When does an alert open a new EPISODE, and which edge of it is announced?
|
|
6
|
+
*
|
|
7
|
+
* The alert centre sends no notification. It stamps every alert it stores with
|
|
8
|
+
* an `episodeId` (`metadata.episodeId`) and announces the opening and the
|
|
9
|
+
* closing of critical and error episodes on the bus; Notification Center turns
|
|
10
|
+
* those into notifications (`alert-critical`, `alert-error`,
|
|
11
|
+
* `alert-critical-resolved`). The identity is what makes a notification
|
|
12
|
+
* once-per-episode: any number of re-emits of an open alert keep the id, a new
|
|
13
|
+
* episode after completion gets a new one.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* The previous episode continues while its alert is still open and the emitter
|
|
17
|
+
* did not mark a new one; anything else opens `<alertId>@<now>`.
|
|
18
|
+
*/
|
|
19
|
+
function nextEpisodeId(input) {
|
|
20
|
+
const { previous } = input;
|
|
21
|
+
if (previous !== null && isAlertEpisodeOpen(previous.status)) {
|
|
22
|
+
if (input.incomingKey === void 0 || input.incomingKey === previous.episodeKey) return previous.episodeId;
|
|
23
|
+
}
|
|
24
|
+
const minted = `${input.alertId}@${String(input.now)}`;
|
|
25
|
+
return previous !== null && previous.episodeId === minted ? `${minted}+` : minted;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The edge to announce for a write that took `previous` to `next`, or `null`.
|
|
29
|
+
* A re-emit that changes nothing about the episode announces nothing; an
|
|
30
|
+
* escalation from `error` to `critical` inside one episode is announced again
|
|
31
|
+
* (it is a different kind, and the operator opted into it separately).
|
|
32
|
+
*/
|
|
33
|
+
function episodeEdge(previous, next) {
|
|
34
|
+
const nextOpen = isAlertEpisodeOpen(next.status);
|
|
35
|
+
const continues = previous !== null && isAlertEpisodeOpen(previous.status) && previous.episodeId === next.episodeId;
|
|
36
|
+
if (nextOpen) {
|
|
37
|
+
if (!isAlertEpisodeSeverity(next.severity)) return null;
|
|
38
|
+
if (!continues || previous === null) return "raised";
|
|
39
|
+
if (!isAlertEpisodeSeverity(previous.severity)) return "raised";
|
|
40
|
+
return previous.severity === "error" && next.severity === "critical" ? "raised" : null;
|
|
41
|
+
}
|
|
42
|
+
if (previous !== null && isAlertEpisodeOpen(previous.status) && isAlertEpisodeSeverity(previous.severity)) return "resolved";
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/builtins/alerts/emit-alert-policy.ts
|
|
47
|
+
function episodeKeyFromMetadata(metadata) {
|
|
48
|
+
const key = metadata?.["episodeKey"];
|
|
49
|
+
return typeof key === "string" ? key : void 0;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Re-emit of the same alert id: preserve `read` when the episode is unchanged
|
|
53
|
+
* and still active. A completed episode starts again.
|
|
54
|
+
*/
|
|
55
|
+
function mergeEmitAlert(input) {
|
|
56
|
+
const incomingKey = episodeKeyFromMetadata(input.incoming.metadata);
|
|
57
|
+
const existingKey = input.existing?.episodeKey;
|
|
58
|
+
if (input.existing?.read === true) {
|
|
59
|
+
const sameEpisode = incomingKey === void 0 || incomingKey === existingKey;
|
|
60
|
+
const priorCompleted = input.existing.status === "completed";
|
|
61
|
+
if (sameEpisode && !priorCompleted) return {
|
|
62
|
+
...input.incoming,
|
|
63
|
+
read: true
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
return input.incoming;
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/builtins/alerts/device-label.ts
|
|
70
|
+
/**
|
|
71
|
+
* Operator-facing device label for alert messages.
|
|
72
|
+
*
|
|
73
|
+
* Prefer a real name; fall back to `Camera <id>` only when nothing else is
|
|
74
|
+
* known. Never prefer the bare id when a name is present — "Camera 108"
|
|
75
|
+
* next to a named "Kitchen" is how the Recording-stopped alerts used to read.
|
|
76
|
+
*/
|
|
77
|
+
function deviceLabelFromEventData(data) {
|
|
78
|
+
const name = stringNonEmpty(data["name"]) ?? stringNonEmpty(data["deviceName"]);
|
|
79
|
+
if (name !== void 0) return name;
|
|
80
|
+
const id = data["deviceId"];
|
|
81
|
+
if (typeof id === "number" && Number.isFinite(id)) return `Camera ${String(id)}`;
|
|
82
|
+
if (typeof id === "string" && id.length > 0) return `Camera ${id}`;
|
|
83
|
+
return "unknown device";
|
|
84
|
+
}
|
|
85
|
+
function stringNonEmpty(value) {
|
|
86
|
+
return typeof value === "string" && value.trim().length > 0 ? value.trim() : void 0;
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/builtins/alerts/prune-policy.ts
|
|
90
|
+
/**
|
|
91
|
+
* Ids older than `cutoffMs`, oldest first.
|
|
92
|
+
*
|
|
93
|
+
* Read state is deliberately NOT consulted — that filter is the defect.
|
|
94
|
+
*/
|
|
95
|
+
function selectExpired(alerts, cutoffMs) {
|
|
96
|
+
return alerts.filter((a) => a.createdAt < cutoffMs).sort((a, b) => a.createdAt - b.createdAt).map((a) => a.id);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Ids to drop so at most `maxAlerts` remain: read ones first (oldest first),
|
|
100
|
+
* then unread ones (oldest first) if that was not enough.
|
|
101
|
+
*
|
|
102
|
+
* Returns empty when already within the cap, and never more than the excess.
|
|
103
|
+
*/
|
|
104
|
+
function selectOverflow(alerts, maxAlerts) {
|
|
105
|
+
if (maxAlerts < 0) return [];
|
|
106
|
+
const excess = alerts.length - maxAlerts;
|
|
107
|
+
if (excess <= 0) return [];
|
|
108
|
+
const byAge = [...alerts].sort((a, b) => a.createdAt - b.createdAt);
|
|
109
|
+
return [...byAge.filter((a) => a.read), ...byAge.filter((a) => !a.read)].slice(0, excess).map((a) => a.id);
|
|
110
|
+
}
|
|
111
|
+
//#endregion
|
|
112
|
+
//#region src/builtins/alerts/runner-alert.ts
|
|
113
|
+
var RUNNER_ALERT_CATEGORIES = [
|
|
114
|
+
"process.crashed",
|
|
115
|
+
"addon.crashed",
|
|
116
|
+
"addon.runner-failed",
|
|
117
|
+
"addon.runner-refused"
|
|
118
|
+
];
|
|
119
|
+
function isRunnerAlertCategory(category) {
|
|
120
|
+
return RUNNER_ALERT_CATEGORIES.includes(category);
|
|
121
|
+
}
|
|
122
|
+
/** Stable alert id of a runner on a node. */
|
|
123
|
+
function runnerAlertId(nodeId, runnerId) {
|
|
124
|
+
return `runner:${nodeId}:${runnerId}`;
|
|
125
|
+
}
|
|
126
|
+
function str(data, key) {
|
|
127
|
+
const value = data[key];
|
|
128
|
+
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
129
|
+
}
|
|
130
|
+
function strList(data, key) {
|
|
131
|
+
const value = data[key];
|
|
132
|
+
return Array.isArray(value) ? value.filter((v) => typeof v === "string") : [];
|
|
133
|
+
}
|
|
134
|
+
/** Which runner an event is about; `null` when it names none. */
|
|
135
|
+
function runnerKeyOf(category, data, source) {
|
|
136
|
+
const nodeId = str(data, "nodeId") ?? source?.nodeId ?? "hub";
|
|
137
|
+
const runnerId = category === "process.crashed" ? str(data, "processId") ?? source?.id ?? "unknown" : category === "addon.crashed" ? str(data, "addonId") ?? source?.id ?? "unknown" : str(data, "runnerId");
|
|
138
|
+
return runnerId === void 0 ? null : {
|
|
139
|
+
nodeId,
|
|
140
|
+
runnerId
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
/** Fold one event into the runner's record. */
|
|
144
|
+
function foldRunnerEvent(previous, category, data, key, now) {
|
|
145
|
+
const base = previous ?? {
|
|
146
|
+
nodeId: key.nodeId,
|
|
147
|
+
runnerId: key.runnerId,
|
|
148
|
+
state: "crashed",
|
|
149
|
+
since: now,
|
|
150
|
+
count: 0,
|
|
151
|
+
addonIds: []
|
|
152
|
+
};
|
|
153
|
+
const addonIds = [...new Set([...base.addonIds, ...strList(data, "addonIds")])];
|
|
154
|
+
const count = base.count + 1;
|
|
155
|
+
switch (category) {
|
|
156
|
+
case "addon.runner-refused": return {
|
|
157
|
+
...base,
|
|
158
|
+
state: "refused",
|
|
159
|
+
count,
|
|
160
|
+
addonIds,
|
|
161
|
+
reason: str(data, "reason") ?? "refused to start",
|
|
162
|
+
...str(data, "remedy") !== void 0 ? { remedy: str(data, "remedy") } : {}
|
|
163
|
+
};
|
|
164
|
+
case "addon.runner-failed": {
|
|
165
|
+
if (base.state === "refused") return {
|
|
166
|
+
...base,
|
|
167
|
+
count,
|
|
168
|
+
addonIds
|
|
169
|
+
};
|
|
170
|
+
const crashes = data["crashesInWindow"];
|
|
171
|
+
return {
|
|
172
|
+
...base,
|
|
173
|
+
state: "failed",
|
|
174
|
+
count,
|
|
175
|
+
addonIds,
|
|
176
|
+
...typeof crashes === "number" ? { crashesInWindow: crashes } : {}
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
case "addon.crashed": {
|
|
180
|
+
const error = str(data, "error");
|
|
181
|
+
const addonId = str(data, "addonId");
|
|
182
|
+
return {
|
|
183
|
+
...base,
|
|
184
|
+
count,
|
|
185
|
+
addonIds: addonId !== void 0 ? [...new Set([...addonIds, addonId])] : addonIds,
|
|
186
|
+
...error !== void 0 ? { lastError: error } : {}
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
case "process.crashed": return {
|
|
190
|
+
...base,
|
|
191
|
+
count,
|
|
192
|
+
addonIds
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
function renderRunnerAlert(record) {
|
|
197
|
+
const where = record.nodeId === "hub" ? record.runnerId : `${record.runnerId} on ${record.nodeId}`;
|
|
198
|
+
switch (record.state) {
|
|
199
|
+
case "refused": return {
|
|
200
|
+
severity: "critical",
|
|
201
|
+
title: "Addon refused to start",
|
|
202
|
+
message: `${where}: refused - ${record.reason ?? "no reason reported"}${record.remedy !== void 0 ? ` ${record.remedy}` : ""}`
|
|
203
|
+
};
|
|
204
|
+
case "failed": return {
|
|
205
|
+
severity: "critical",
|
|
206
|
+
title: "Addon crash loop",
|
|
207
|
+
message: `Runner "${where}" gave up${record.crashesInWindow !== void 0 ? ` after ${String(record.crashesInWindow)} crashes` : ""}${record.addonIds.length > 0 ? ` (addons: ${record.addonIds.join(", ")})` : ""} - ${String(record.count)} events`
|
|
208
|
+
};
|
|
209
|
+
case "crashed": return {
|
|
210
|
+
severity: "error",
|
|
211
|
+
title: "Addon crashed",
|
|
212
|
+
message: `Addon "${where}" crashed${record.lastError !== void 0 ? `: ${record.lastError}` : ""}${record.count > 1 ? ` (${String(record.count)} events)` : ""}`
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
//#endregion
|
|
217
|
+
//#region src/builtins/alerts/record-kinds.ts
|
|
218
|
+
var import_read_all_rows = require_read_all_rows();
|
|
219
|
+
/**
|
|
220
|
+
* Record kinds owned by alert-center (records plan phase 4).
|
|
221
|
+
*/
|
|
222
|
+
/** The legacy collection the kind replaced (canonical KV before phase 4); read only without records. */
|
|
223
|
+
var ALERTS_COLLECTION = "alerts";
|
|
224
|
+
var _alertCenterRecordKinds = defineRecordKinds({ alerts: {
|
|
225
|
+
schema: AlertSchema.omit({ id: true }),
|
|
226
|
+
class: "audit",
|
|
227
|
+
writeTrigger: "EventBus categories the alert center tracks, operator mark read/dismiss, and model-download progress merges",
|
|
228
|
+
device: "none",
|
|
229
|
+
at: "none",
|
|
230
|
+
indexes: [
|
|
231
|
+
{
|
|
232
|
+
name: "read",
|
|
233
|
+
fields: ["read"]
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
name: "created_at",
|
|
237
|
+
fields: ["createdAt"]
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
name: "updated_at",
|
|
241
|
+
fields: ["updatedAt"]
|
|
242
|
+
}
|
|
243
|
+
],
|
|
244
|
+
retention: {
|
|
245
|
+
owner: "alert-center",
|
|
246
|
+
reason: "maxAlerts cap and retentionDays enforced on write (enforceMaxAlerts / enforceRetention); read alerts preferred when trimming overflow"
|
|
247
|
+
}
|
|
248
|
+
} });
|
|
249
|
+
var alertCenterRecordKinds = _alertCenterRecordKinds;
|
|
250
|
+
/** Narrow kind for `records.kind()` — `IsolatedRecordKinds` string index is `| undefined`. */
|
|
251
|
+
var alertsRecordKind = _alertCenterRecordKinds.alerts;
|
|
252
|
+
//#endregion
|
|
253
|
+
//#region src/builtins/alerts/alert-store.ts
|
|
254
|
+
function toRecord(row) {
|
|
255
|
+
return {
|
|
256
|
+
id: row.id,
|
|
257
|
+
data: row.data
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
function toRecordFromLegacy(row) {
|
|
261
|
+
return {
|
|
262
|
+
id: row.id,
|
|
263
|
+
data: row.data
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
function isRecord(value) {
|
|
267
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
268
|
+
}
|
|
269
|
+
function legacyGetData(value) {
|
|
270
|
+
if (!isRecord(value)) return null;
|
|
271
|
+
if ("data" in value) {
|
|
272
|
+
const data = value.data;
|
|
273
|
+
return isRecord(data) ? data : null;
|
|
274
|
+
}
|
|
275
|
+
return value;
|
|
276
|
+
}
|
|
277
|
+
var AlertStore = class AlertStore {
|
|
278
|
+
kind;
|
|
279
|
+
legacyStore;
|
|
280
|
+
constructor(kind, legacyStore) {
|
|
281
|
+
this.kind = kind;
|
|
282
|
+
this.legacyStore = legacyStore;
|
|
283
|
+
}
|
|
284
|
+
static of(records) {
|
|
285
|
+
return new AlertStore(records.kind(alertsRecordKind), null);
|
|
286
|
+
}
|
|
287
|
+
static legacy(store) {
|
|
288
|
+
return new AlertStore(null, store);
|
|
289
|
+
}
|
|
290
|
+
async legacyRows() {
|
|
291
|
+
const store = this.legacyStore;
|
|
292
|
+
if (store === null) return [];
|
|
293
|
+
return (await store.query.query({
|
|
294
|
+
collection: ALERTS_COLLECTION,
|
|
295
|
+
filter: {}
|
|
296
|
+
})).map((row) => toRecordFromLegacy({
|
|
297
|
+
id: row.id,
|
|
298
|
+
data: row.data
|
|
299
|
+
}));
|
|
300
|
+
}
|
|
301
|
+
async list(filter) {
|
|
302
|
+
let out;
|
|
303
|
+
const kind = this.kind;
|
|
304
|
+
if (kind !== null) out = (await (0, import_read_all_rows.readAllRows)(kind, { order: "id" })).map(toRecord);
|
|
305
|
+
else out = [...await this.legacyRows()];
|
|
306
|
+
if (filter?.unreadOnly === true) out = out.filter((r) => r.data["read"] === false);
|
|
307
|
+
out.sort((a, b) => Number(b.data["updatedAt"] ?? 0) - Number(a.data["updatedAt"] ?? 0));
|
|
308
|
+
const limit = filter?.limit ?? 100;
|
|
309
|
+
return out.slice(0, limit);
|
|
310
|
+
}
|
|
311
|
+
async countUnread() {
|
|
312
|
+
return (await this.list({
|
|
313
|
+
unreadOnly: true,
|
|
314
|
+
limit: 1e4
|
|
315
|
+
})).length;
|
|
316
|
+
}
|
|
317
|
+
async countAll() {
|
|
318
|
+
const kind = this.kind;
|
|
319
|
+
if (kind !== null) return (await (0, import_read_all_rows.readAllRows)(kind)).length;
|
|
320
|
+
return (await this.legacyRows()).length;
|
|
321
|
+
}
|
|
322
|
+
async getData(id) {
|
|
323
|
+
const kind = this.kind;
|
|
324
|
+
if (kind !== null) {
|
|
325
|
+
const row = await kind.get(id);
|
|
326
|
+
if (row === null) return null;
|
|
327
|
+
return row.data;
|
|
328
|
+
}
|
|
329
|
+
const store = this.legacyStore;
|
|
330
|
+
if (store === null) return null;
|
|
331
|
+
return legacyGetData(await store.get.query({
|
|
332
|
+
collection: ALERTS_COLLECTION,
|
|
333
|
+
key: id
|
|
334
|
+
}));
|
|
335
|
+
}
|
|
336
|
+
async mergeUpdate(id, patch) {
|
|
337
|
+
const existing = await this.getData(id);
|
|
338
|
+
if (existing === null) return;
|
|
339
|
+
await this.putRaw(id, {
|
|
340
|
+
...existing,
|
|
341
|
+
...patch
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
async persist(alert) {
|
|
345
|
+
const { id, ...body } = alert;
|
|
346
|
+
const data = alertsRecordKind.schema.parse(body);
|
|
347
|
+
const kind = this.kind;
|
|
348
|
+
if (kind !== null) {
|
|
349
|
+
await kind.put({
|
|
350
|
+
id,
|
|
351
|
+
data
|
|
352
|
+
});
|
|
353
|
+
return;
|
|
354
|
+
}
|
|
355
|
+
await this.putRaw(id, {
|
|
356
|
+
...body,
|
|
357
|
+
id
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
async putRaw(id, data) {
|
|
361
|
+
const { id: _drop, ...body } = AlertSchema.parse({
|
|
362
|
+
id,
|
|
363
|
+
...data
|
|
364
|
+
});
|
|
365
|
+
const kind = this.kind;
|
|
366
|
+
if (kind !== null) {
|
|
367
|
+
await kind.put({
|
|
368
|
+
id,
|
|
369
|
+
data: body
|
|
370
|
+
});
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
const store = this.legacyStore;
|
|
374
|
+
if (store === null) return;
|
|
375
|
+
await store.set.mutate({
|
|
376
|
+
collection: ALERTS_COLLECTION,
|
|
377
|
+
key: id,
|
|
378
|
+
value: {
|
|
379
|
+
id,
|
|
380
|
+
...body
|
|
381
|
+
}
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
async delete(id) {
|
|
385
|
+
const kind = this.kind;
|
|
386
|
+
if (kind !== null) {
|
|
387
|
+
await kind.delete(id);
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
const store = this.legacyStore;
|
|
391
|
+
if (store === null) return;
|
|
392
|
+
await store.delete.mutate({
|
|
393
|
+
collection: ALERTS_COLLECTION,
|
|
394
|
+
key: id
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
async listAllByCreatedAtAsc() {
|
|
398
|
+
const kind = this.kind;
|
|
399
|
+
let out;
|
|
400
|
+
if (kind !== null) out = (await (0, import_read_all_rows.readAllRows)(kind)).map(toRecord);
|
|
401
|
+
else out = [...await this.legacyRows()];
|
|
402
|
+
out.sort((a, b) => Number(a.data["createdAt"] ?? 0) - Number(b.data["createdAt"] ?? 0));
|
|
403
|
+
return out;
|
|
404
|
+
}
|
|
405
|
+
async listRecent(limit) {
|
|
406
|
+
const kind = this.kind;
|
|
407
|
+
let out;
|
|
408
|
+
if (kind !== null) out = (await (0, import_read_all_rows.readAllRows)(kind, { order: "id" })).map(toRecord);
|
|
409
|
+
else out = [...await this.legacyRows()];
|
|
410
|
+
out.sort((a, b) => Number(b.data["updatedAt"] ?? 0) - Number(a.data["updatedAt"] ?? 0));
|
|
411
|
+
return out.slice(0, limit);
|
|
412
|
+
}
|
|
413
|
+
async findWhereDataField(field, value) {
|
|
414
|
+
const kind = this.kind;
|
|
415
|
+
if (kind !== null) return (await (0, import_read_all_rows.readAllRows)(kind)).filter((r) => r.data[field] === value).map(toRecord);
|
|
416
|
+
return (await this.legacyRows()).filter((r) => r.data[field] === value);
|
|
417
|
+
}
|
|
418
|
+
};
|
|
419
|
+
//#endregion
|
|
420
|
+
//#region src/builtins/alerts/migration-alerts.ts
|
|
421
|
+
var MIGRATION_ALERT_PREFIX = "migration:";
|
|
422
|
+
function faulted(entry) {
|
|
423
|
+
if (entry.status === "failed") return "critical";
|
|
424
|
+
if (entry.status === "blocked" && entry.reason === "snapshot-refused") return "critical";
|
|
425
|
+
if (entry.status === "skipped-newer") return "warning";
|
|
426
|
+
return null;
|
|
427
|
+
}
|
|
428
|
+
function messageOf(entry) {
|
|
429
|
+
if (entry.status === "failed") return `Migration ${entry.id} failed and was rolled back: ${entry.error ?? "no error recorded"}. What depends on it is blocked until it is retried.`;
|
|
430
|
+
if (entry.status === "blocked") return `Migration ${entry.id} did not run: the safety snapshot before it could not be written. Free disk space and retry.`;
|
|
431
|
+
return `The database holds migration ${entry.id}, which this version does not know. It was left untouched; update this node to the version that wrote it.`;
|
|
432
|
+
}
|
|
433
|
+
function planMigrationAlerts(ledger, open, now) {
|
|
434
|
+
const raise = [];
|
|
435
|
+
const faultedIds = /* @__PURE__ */ new Set();
|
|
436
|
+
for (const entry of ledger) {
|
|
437
|
+
const severity = faulted(entry);
|
|
438
|
+
if (severity === null) continue;
|
|
439
|
+
const id = `${MIGRATION_ALERT_PREFIX}${entry.id}`;
|
|
440
|
+
faultedIds.add(id);
|
|
441
|
+
raise.push({
|
|
442
|
+
id,
|
|
443
|
+
category: EventCategory.MigrationFailed,
|
|
444
|
+
severity,
|
|
445
|
+
title: severity === "critical" ? "Migration failed" : "Database is newer than this version",
|
|
446
|
+
message: messageOf(entry),
|
|
447
|
+
...severity === "critical" ? { action: {
|
|
448
|
+
label: "Retry",
|
|
449
|
+
invoke: {
|
|
450
|
+
addonId: "sqlite-settings",
|
|
451
|
+
action: "retryMigration",
|
|
452
|
+
input: { id: entry.id }
|
|
453
|
+
}
|
|
454
|
+
} } : {},
|
|
455
|
+
status: "active",
|
|
456
|
+
read: false,
|
|
457
|
+
createdAt: now,
|
|
458
|
+
updatedAt: now,
|
|
459
|
+
source: {
|
|
460
|
+
type: "addon",
|
|
461
|
+
id: "sqlite-settings"
|
|
462
|
+
},
|
|
463
|
+
metadata: {
|
|
464
|
+
migrationId: entry.id,
|
|
465
|
+
owner: entry.owner,
|
|
466
|
+
database: entry.database
|
|
467
|
+
}
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
return {
|
|
471
|
+
raise,
|
|
472
|
+
dismiss: open.filter((alert) => alert.status === "active" && alert.id.startsWith("migration:") && !faultedIds.has(alert.id)).map((alert) => alert.id)
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
//#endregion
|
|
476
|
+
//#region src/builtins/alerts/alerts.addon.ts
|
|
477
|
+
var CATEGORY_MAPPINGS = {
|
|
478
|
+
"addon.crashed": {
|
|
479
|
+
severity: "error",
|
|
480
|
+
titleTemplate: "Addon crashed"
|
|
481
|
+
},
|
|
482
|
+
"addon.runner-failed": {
|
|
483
|
+
severity: "error",
|
|
484
|
+
titleTemplate: "Addon crash loop"
|
|
485
|
+
},
|
|
486
|
+
"addon.runner-refused": {
|
|
487
|
+
severity: "error",
|
|
488
|
+
titleTemplate: "Addon refused to start"
|
|
489
|
+
},
|
|
490
|
+
"system.runner-check": {
|
|
491
|
+
severity: "error",
|
|
492
|
+
titleTemplate: "Runners degraded"
|
|
493
|
+
},
|
|
494
|
+
"addon.error": {
|
|
495
|
+
severity: "error",
|
|
496
|
+
titleTemplate: "Addon error"
|
|
497
|
+
},
|
|
498
|
+
"process.crashed": {
|
|
499
|
+
severity: "error",
|
|
500
|
+
titleTemplate: "Process crashed"
|
|
501
|
+
},
|
|
502
|
+
"recording.error": {
|
|
503
|
+
severity: "error",
|
|
504
|
+
titleTemplate: "Recording error"
|
|
505
|
+
},
|
|
506
|
+
"recording.storage.critical": {
|
|
507
|
+
severity: "warning",
|
|
508
|
+
titleTemplate: "Storage critical"
|
|
509
|
+
},
|
|
510
|
+
"notification.failed": {
|
|
511
|
+
severity: "error",
|
|
512
|
+
titleTemplate: "Notification failed"
|
|
513
|
+
},
|
|
514
|
+
"agent.offline": {
|
|
515
|
+
severity: "warning",
|
|
516
|
+
titleTemplate: "Agent disconnected"
|
|
517
|
+
},
|
|
518
|
+
"system.restarting": {
|
|
519
|
+
severity: "warning",
|
|
520
|
+
titleTemplate: "System restarting"
|
|
521
|
+
},
|
|
522
|
+
"system.restart-completed": {
|
|
523
|
+
severity: "info",
|
|
524
|
+
titleTemplate: "Node updated"
|
|
525
|
+
},
|
|
526
|
+
"update.available": {
|
|
527
|
+
severity: "info",
|
|
528
|
+
titleTemplate: "Update available"
|
|
529
|
+
},
|
|
530
|
+
"system.tls-cert-changed": {
|
|
531
|
+
severity: "warning",
|
|
532
|
+
titleTemplate: "TLS certificate changed"
|
|
533
|
+
},
|
|
534
|
+
"device.unregistered": {
|
|
535
|
+
severity: "warning",
|
|
536
|
+
titleTemplate: "Device unregistered"
|
|
537
|
+
},
|
|
538
|
+
"addon.installed": {
|
|
539
|
+
severity: "info",
|
|
540
|
+
titleTemplate: "Addon installed"
|
|
541
|
+
},
|
|
542
|
+
"addon.updated": {
|
|
543
|
+
severity: "info",
|
|
544
|
+
titleTemplate: "Addon updated"
|
|
545
|
+
},
|
|
546
|
+
"addon.uninstalled": {
|
|
547
|
+
severity: "info",
|
|
548
|
+
titleTemplate: "Addon uninstalled"
|
|
549
|
+
},
|
|
550
|
+
"addon.load-failed": {
|
|
551
|
+
severity: "error",
|
|
552
|
+
titleTemplate: "Addon failed to load"
|
|
553
|
+
},
|
|
554
|
+
"system.liveness-failed": {
|
|
555
|
+
severity: "error",
|
|
556
|
+
titleTemplate: "Node liveness"
|
|
557
|
+
},
|
|
558
|
+
"stream.offline": {
|
|
559
|
+
severity: "warning",
|
|
560
|
+
titleTemplate: "Stream offline"
|
|
561
|
+
},
|
|
562
|
+
"notification.rule-broken": {
|
|
563
|
+
severity: "warning",
|
|
564
|
+
titleTemplate: "Notification rule broken"
|
|
565
|
+
},
|
|
566
|
+
"backup.restored": {
|
|
567
|
+
severity: "info",
|
|
568
|
+
titleTemplate: "Backup restored"
|
|
569
|
+
},
|
|
570
|
+
"model.download.progress": {
|
|
571
|
+
severity: "info",
|
|
572
|
+
titleTemplate: "Model download"
|
|
573
|
+
}
|
|
574
|
+
};
|
|
575
|
+
/**
|
|
576
|
+
* Subscribed for dismiss / merge side-effects only — never mint a card.
|
|
577
|
+
* Must stay in the subscribe set even though they are absent from
|
|
578
|
+
* {@link CATEGORY_MAPPINGS}.
|
|
579
|
+
*/
|
|
580
|
+
var SILENT_TRACKED_CATEGORIES = [
|
|
581
|
+
"process.state-changed",
|
|
582
|
+
"addon.load-recovered",
|
|
583
|
+
"system.liveness-recovered",
|
|
584
|
+
"stream.online",
|
|
585
|
+
"notification.rule-repaired",
|
|
586
|
+
"migration.failed",
|
|
587
|
+
"migration.applied"
|
|
588
|
+
];
|
|
589
|
+
/** The `stream.offline` reasons that are an outage (D883) — mirrors the broker's `isStreamOutageReason`. */
|
|
590
|
+
var STREAM_OUTAGE_REASONS = [
|
|
591
|
+
"stale-timeout",
|
|
592
|
+
"wake-timeout",
|
|
593
|
+
"connection-error",
|
|
594
|
+
"battery-unreachable"
|
|
595
|
+
];
|
|
596
|
+
/** The streams an offline event covers: its list, else the one stream it names. */
|
|
597
|
+
function streamIdsOf(listed, fallback) {
|
|
598
|
+
if (Array.isArray(listed)) {
|
|
599
|
+
const ids = listed.filter((id) => typeof id === "string");
|
|
600
|
+
if (ids.length > 0) return ids;
|
|
601
|
+
}
|
|
602
|
+
return fallback !== void 0 ? [fallback] : [];
|
|
603
|
+
}
|
|
604
|
+
var TRACKED_CATEGORIES = [...Object.keys(CATEGORY_MAPPINGS), ...SILENT_TRACKED_CATEGORIES];
|
|
605
|
+
/**
|
|
606
|
+
* `[ALERT-CENTER-EVENTS]` — rate limiting. Events that fire thousands of
|
|
607
|
+
* times a minute (flaky cam reconnecting, chatty integration, …) would
|
|
608
|
+
* flood the alert feed and push genuinely important alerts off the
|
|
609
|
+
* visible page. We collapse bursts into a single throttled summary per
|
|
610
|
+
* `(category, source.id)` tuple: the first N events within the window
|
|
611
|
+
* still surface as individual alerts, but once the source crosses the
|
|
612
|
+
* threshold we stop emitting alerts for it and wait out the window.
|
|
613
|
+
*
|
|
614
|
+
* A standalone category-count map is cleared on every window rollover.
|
|
615
|
+
* Keep the threshold generous enough that legitimate bursts of ~a few
|
|
616
|
+
* per minute still get through, but strict enough that a reconnect loop
|
|
617
|
+
* firing every second gets muted.
|
|
618
|
+
*/
|
|
619
|
+
var RATE_LIMIT_WINDOW_MS = 6e4;
|
|
620
|
+
var RATE_LIMIT_MAX_PER_SOURCE = 5;
|
|
621
|
+
/** The alert `category` a runner record carries - the state it is in. */
|
|
622
|
+
function runnerCategoryOf(state) {
|
|
623
|
+
return state === "refused" ? "addon.runner-refused" : state === "failed" ? "addon.runner-failed" : "addon.crashed";
|
|
624
|
+
}
|
|
625
|
+
function parseRunnerRecord(value) {
|
|
626
|
+
if (typeof value !== "object" || value === null) return null;
|
|
627
|
+
const rec = value;
|
|
628
|
+
const state = rec["state"];
|
|
629
|
+
if (typeof rec["nodeId"] !== "string" || typeof rec["runnerId"] !== "string" || state !== "crashed" && state !== "failed" && state !== "refused" || typeof rec["count"] !== "number" || !Array.isArray(rec["addonIds"])) return null;
|
|
630
|
+
return {
|
|
631
|
+
nodeId: rec["nodeId"],
|
|
632
|
+
runnerId: rec["runnerId"],
|
|
633
|
+
state,
|
|
634
|
+
since: typeof rec["since"] === "number" ? rec["since"] : 0,
|
|
635
|
+
count: rec["count"],
|
|
636
|
+
addonIds: rec["addonIds"].filter((x) => typeof x === "string"),
|
|
637
|
+
...typeof rec["lastError"] === "string" ? { lastError: rec["lastError"] } : {},
|
|
638
|
+
...typeof rec["reason"] === "string" ? { reason: rec["reason"] } : {},
|
|
639
|
+
...typeof rec["remedy"] === "string" ? { remedy: rec["remedy"] } : {},
|
|
640
|
+
...typeof rec["crashesInWindow"] === "number" ? { crashesInWindow: rec["crashesInWindow"] } : {}
|
|
641
|
+
};
|
|
642
|
+
}
|
|
643
|
+
/** Parse a raw settings record into a validated Alert. */
|
|
644
|
+
function parseAlert(record) {
|
|
645
|
+
return AlertSchema.parse({
|
|
646
|
+
id: record.id,
|
|
647
|
+
...record.data
|
|
648
|
+
});
|
|
649
|
+
}
|
|
650
|
+
var DEFAULT_CONFIG = {
|
|
651
|
+
maxAlerts: 500,
|
|
652
|
+
retentionDays: 30
|
|
653
|
+
};
|
|
654
|
+
var EVENT_SOURCE = {
|
|
655
|
+
type: "addon",
|
|
656
|
+
id: "alert-center"
|
|
657
|
+
};
|
|
658
|
+
/** Where the operator acts on a runner that failed, was refused or is missing. */
|
|
659
|
+
var ADDONS_PAGE_ACTION = {
|
|
660
|
+
label: "Open Addons",
|
|
661
|
+
href: "/system/addons"
|
|
662
|
+
};
|
|
663
|
+
function episodeViewOf(alert) {
|
|
664
|
+
const key = episodeKeyFromMetadata(alert.metadata);
|
|
665
|
+
return {
|
|
666
|
+
status: alert.status,
|
|
667
|
+
severity: alert.severity,
|
|
668
|
+
episodeId: alertEpisodeId(alert),
|
|
669
|
+
...key !== void 0 ? { episodeKey: key } : {}
|
|
670
|
+
};
|
|
671
|
+
}
|
|
672
|
+
/**
|
|
673
|
+
* Alert Center addon — core builtin that persists alerts in a
|
|
674
|
+
* structured SQLite table and serves them to the admin UI.
|
|
675
|
+
*
|
|
676
|
+
* Registers as an `alerts` collection provider and subscribes to
|
|
677
|
+
* important EventBus categories to create/update alerts automatically.
|
|
678
|
+
*/
|
|
679
|
+
/** Project a stored alert row onto the fields the prune policy needs. */
|
|
680
|
+
function toPrunable(record) {
|
|
681
|
+
return {
|
|
682
|
+
id: record.id,
|
|
683
|
+
createdAt: Number(record.data["createdAt"] ?? 0),
|
|
684
|
+
read: record.data["read"] === true
|
|
685
|
+
};
|
|
686
|
+
}
|
|
687
|
+
var AlertCenterAddon = class extends BaseAddon {
|
|
688
|
+
alertStore = null;
|
|
689
|
+
unsubscribers = [];
|
|
690
|
+
constructor() {
|
|
691
|
+
super({ ...DEFAULT_CONFIG });
|
|
692
|
+
}
|
|
693
|
+
/**
|
|
694
|
+
* Per `(category, source.id)` counter used to rate-limit chatty
|
|
695
|
+
* events. Entries are pruned lazily when they age out of
|
|
696
|
+
* `RATE_LIMIT_WINDOW_MS`; see `shouldSuppressByRate()` below.
|
|
697
|
+
*/
|
|
698
|
+
rateLimitCounters = /* @__PURE__ */ new Map();
|
|
699
|
+
async onInitialize() {
|
|
700
|
+
const records = this.ctx.records;
|
|
701
|
+
const store = this.ctx.api?.settingsStore;
|
|
702
|
+
if (records !== void 0) await records.declare(alertCenterRecordKinds);
|
|
703
|
+
this.alertStore = records !== void 0 ? AlertStore.of(records) : store === void 0 ? null : AlertStore.legacy(store);
|
|
704
|
+
if (this.alertStore === null) throw new Error("alert-center needs ctx.records or settings-store on the hub");
|
|
705
|
+
const alertsProvider = {
|
|
706
|
+
emit: (alert) => this.emitAlert(alert),
|
|
707
|
+
update: (input) => this.updateAlert(input.alertId, input.patch),
|
|
708
|
+
list: (filter) => this.listAlerts(filter),
|
|
709
|
+
getUnreadCount: () => this.getUnreadCount(),
|
|
710
|
+
markRead: (input) => this.markRead(input.alertId),
|
|
711
|
+
markAllRead: () => this.markAllRead(),
|
|
712
|
+
dismiss: (input) => this.dismiss(input.alertId)
|
|
713
|
+
};
|
|
714
|
+
const unsubs = [];
|
|
715
|
+
for (const category of TRACKED_CATEGORIES) {
|
|
716
|
+
const unsub = this.ctx.eventBus.subscribe({ category }, (event) => {
|
|
717
|
+
this.handleEvent(category, event);
|
|
718
|
+
});
|
|
719
|
+
unsubs.push(unsub);
|
|
720
|
+
}
|
|
721
|
+
this.unsubscribers = unsubs;
|
|
722
|
+
this.dismissLegacyStreamCards(void 0);
|
|
723
|
+
this.reconcileMigrationAlerts();
|
|
724
|
+
this.ctx.logger.info("Initialized", { meta: { trackedCategoriesCount: TRACKED_CATEGORIES.length } });
|
|
725
|
+
return [{
|
|
726
|
+
capability: alertsCapability,
|
|
727
|
+
provider: alertsProvider
|
|
728
|
+
}];
|
|
729
|
+
}
|
|
730
|
+
async onShutdown() {
|
|
731
|
+
for (const unsub of this.unsubscribers) unsub();
|
|
732
|
+
this.unsubscribers = [];
|
|
733
|
+
}
|
|
734
|
+
globalSettingsSchema() {
|
|
735
|
+
return this.schema({ sections: [{
|
|
736
|
+
id: "alerts",
|
|
737
|
+
title: "Alert Center",
|
|
738
|
+
titleKey: "server:globalSettings.s_alerts.title",
|
|
739
|
+
description: "Configure alert storage and retention.",
|
|
740
|
+
descriptionKey: "server:globalSettings.s_alerts.description",
|
|
741
|
+
columns: 1,
|
|
742
|
+
fields: [this.field({
|
|
743
|
+
type: "number",
|
|
744
|
+
key: "maxAlerts",
|
|
745
|
+
label: "Maximum stored alerts",
|
|
746
|
+
labelKey: "server:globalSettings.s_alerts.maxAlerts.label",
|
|
747
|
+
description: "Oldest read alerts are deleted when this limit is exceeded.",
|
|
748
|
+
descriptionKey: "server:globalSettings.s_alerts.maxAlerts.description",
|
|
749
|
+
min: 50,
|
|
750
|
+
max: 5e3,
|
|
751
|
+
step: 50,
|
|
752
|
+
default: 500
|
|
753
|
+
}), this.field({
|
|
754
|
+
type: "number",
|
|
755
|
+
key: "retentionDays",
|
|
756
|
+
label: "Alert retention (days)",
|
|
757
|
+
labelKey: "server:globalSettings.s_alerts.retentionDays.label",
|
|
758
|
+
description: "Alerts older than this are automatically removed.",
|
|
759
|
+
descriptionKey: "server:globalSettings.s_alerts.retentionDays.description",
|
|
760
|
+
min: 1,
|
|
761
|
+
max: 365,
|
|
762
|
+
step: 1,
|
|
763
|
+
default: 30
|
|
764
|
+
})]
|
|
765
|
+
}] });
|
|
766
|
+
}
|
|
767
|
+
async listAlerts(filter) {
|
|
768
|
+
const store = this.alertStore;
|
|
769
|
+
if (store === null) return [];
|
|
770
|
+
return (await store.list(filter)).map(parseAlert);
|
|
771
|
+
}
|
|
772
|
+
async getUnreadCount() {
|
|
773
|
+
const store = this.alertStore;
|
|
774
|
+
if (store === null) return 0;
|
|
775
|
+
return store.countUnread();
|
|
776
|
+
}
|
|
777
|
+
async markRead(alertId) {
|
|
778
|
+
await this.mergeUpdate(alertId, {
|
|
779
|
+
read: true,
|
|
780
|
+
updatedAt: Date.now()
|
|
781
|
+
});
|
|
782
|
+
}
|
|
783
|
+
async markAllRead() {
|
|
784
|
+
const store = this.alertStore;
|
|
785
|
+
if (store === null) return;
|
|
786
|
+
const unread = await store.list({
|
|
787
|
+
unreadOnly: true,
|
|
788
|
+
limit: 1e4
|
|
789
|
+
});
|
|
790
|
+
const now = Date.now();
|
|
791
|
+
for (const record of unread) await this.mergeUpdate(record.id, {
|
|
792
|
+
read: true,
|
|
793
|
+
updatedAt: now
|
|
794
|
+
});
|
|
795
|
+
}
|
|
796
|
+
async dismiss(alertId) {
|
|
797
|
+
await this.mergeUpdate(alertId, {
|
|
798
|
+
status: "dismissed",
|
|
799
|
+
read: true,
|
|
800
|
+
updatedAt: Date.now()
|
|
801
|
+
});
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* Events are handled one at a time: every handler is a read-modify-write of
|
|
805
|
+
* an alert, and two concurrent events about one runner would both read "no
|
|
806
|
+
* alert yet" and open two episodes for it.
|
|
807
|
+
*/
|
|
808
|
+
eventChain = Promise.resolve();
|
|
809
|
+
handleEvent(category, event) {
|
|
810
|
+
this.eventChain = this.eventChain.then(() => this.processEvent(category, event));
|
|
811
|
+
return this.eventChain;
|
|
812
|
+
}
|
|
813
|
+
async processEvent(category, event) {
|
|
814
|
+
try {
|
|
815
|
+
if (category === "model.download.progress") {
|
|
816
|
+
await this.handleModelDownload(event);
|
|
817
|
+
return;
|
|
818
|
+
}
|
|
819
|
+
if (isRunnerAlertCategory(category)) {
|
|
820
|
+
await this.handleRunnerEvent(category, event);
|
|
821
|
+
return;
|
|
822
|
+
}
|
|
823
|
+
if (category === EventCategory.ProcessStateChanged) {
|
|
824
|
+
await this.handleRunnerStateChanged(event);
|
|
825
|
+
return;
|
|
826
|
+
}
|
|
827
|
+
if (category === EventCategory.SystemRunnerCheck) {
|
|
828
|
+
await this.handleRunnerCheck(event);
|
|
829
|
+
return;
|
|
830
|
+
}
|
|
831
|
+
if (category === EventCategory.AddonLoadFailed) {
|
|
832
|
+
await this.handleAddonLoadFailed(event);
|
|
833
|
+
return;
|
|
834
|
+
}
|
|
835
|
+
if (category === EventCategory.AddonLoadRecovered) {
|
|
836
|
+
await this.handleAddonLoadRecovered(event);
|
|
837
|
+
return;
|
|
838
|
+
}
|
|
839
|
+
if (category === EventCategory.SystemLivenessFailed) {
|
|
840
|
+
await this.handleLivenessFailed(event);
|
|
841
|
+
return;
|
|
842
|
+
}
|
|
843
|
+
if (category === EventCategory.SystemLivenessRecovered) {
|
|
844
|
+
await this.handleLivenessRecovered(event);
|
|
845
|
+
return;
|
|
846
|
+
}
|
|
847
|
+
if (category === EventCategory.StreamOffline) {
|
|
848
|
+
await this.handleStreamOffline(event);
|
|
849
|
+
return;
|
|
850
|
+
}
|
|
851
|
+
if (category === EventCategory.StreamOnline) {
|
|
852
|
+
await this.handleStreamOnline(event);
|
|
853
|
+
return;
|
|
854
|
+
}
|
|
855
|
+
if (category === EventCategory.MigrationFailed || category === EventCategory.MigrationApplied) {
|
|
856
|
+
await this.reconcileMigrationAlerts();
|
|
857
|
+
return;
|
|
858
|
+
}
|
|
859
|
+
if (category === EventCategory.NotificationRuleBroken) {
|
|
860
|
+
await this.handleRuleBroken(event);
|
|
861
|
+
return;
|
|
862
|
+
}
|
|
863
|
+
if (category === EventCategory.NotificationRuleRepaired) {
|
|
864
|
+
await this.handleRuleRepaired(event);
|
|
865
|
+
return;
|
|
866
|
+
}
|
|
867
|
+
const mapping = CATEGORY_MAPPINGS[category];
|
|
868
|
+
if (!mapping) return;
|
|
869
|
+
if (category === "addon.updated") {
|
|
870
|
+
const toVersion = event.data["toVersion"];
|
|
871
|
+
if (typeof toVersion !== "string" || toVersion.length === 0) return;
|
|
872
|
+
}
|
|
873
|
+
if (this.shouldSuppressByRate(category, event)) return;
|
|
874
|
+
const message = this.buildMessage(category, event.data, event.source ? String(event.source.id) : void 0);
|
|
875
|
+
const addonIdForKey = (typeof event.data["addonId"] === "string" ? event.data["addonId"] : void 0) ?? (event.source ? String(event.source.id) : void 0);
|
|
876
|
+
const toVersionForKey = typeof event.data["toVersion"] === "string" ? event.data["toVersion"] : void 0;
|
|
877
|
+
const alert = {
|
|
878
|
+
id: category === "addon.updated" && addonIdForKey !== void 0 && toVersionForKey !== void 0 ? `addon-updated:${addonIdForKey}:${toVersionForKey}` : crypto.randomUUID(),
|
|
879
|
+
category,
|
|
880
|
+
severity: mapping.severity,
|
|
881
|
+
title: mapping.titleTemplate,
|
|
882
|
+
message,
|
|
883
|
+
status: "active",
|
|
884
|
+
read: false,
|
|
885
|
+
createdAt: Date.now(),
|
|
886
|
+
updatedAt: Date.now(),
|
|
887
|
+
source: event.source ? {
|
|
888
|
+
type: event.source.type,
|
|
889
|
+
id: String(event.source.id)
|
|
890
|
+
} : void 0,
|
|
891
|
+
metadata: event.data
|
|
892
|
+
};
|
|
893
|
+
await this.emitAlert(alert);
|
|
894
|
+
} catch (err) {
|
|
895
|
+
this.ctx.logger?.warn("Failed to handle event", { meta: {
|
|
896
|
+
category,
|
|
897
|
+
error: errMsg(err)
|
|
898
|
+
} });
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
async readRunnerRecord(alertId) {
|
|
902
|
+
const store = this.alertStore;
|
|
903
|
+
if (store === null) return null;
|
|
904
|
+
const raw = await store.getData(alertId);
|
|
905
|
+
if (raw === null) return null;
|
|
906
|
+
const alert = AlertSchema.safeParse({
|
|
907
|
+
id: alertId,
|
|
908
|
+
...raw
|
|
909
|
+
});
|
|
910
|
+
if (!alert.success || alert.data.status === "dismissed") return null;
|
|
911
|
+
return parseRunnerRecord(alert.data.metadata?.["runner"]);
|
|
912
|
+
}
|
|
913
|
+
async handleRunnerEvent(category, event) {
|
|
914
|
+
if (!isRunnerAlertCategory(category)) return;
|
|
915
|
+
const key = runnerKeyOf(category, event.data, event.source ? {
|
|
916
|
+
id: String(event.source.id),
|
|
917
|
+
...typeof event.source.nodeId === "string" ? { nodeId: event.source.nodeId } : {}
|
|
918
|
+
} : void 0);
|
|
919
|
+
if (key === null) return;
|
|
920
|
+
const alertId = runnerAlertId(key.nodeId, key.runnerId);
|
|
921
|
+
const previous = await this.readRunnerRecord(alertId);
|
|
922
|
+
const record = foldRunnerEvent(previous, category, event.data, key, Date.now());
|
|
923
|
+
const rendered = renderRunnerAlert(record);
|
|
924
|
+
const existing = await this.readAlertRaw(alertId);
|
|
925
|
+
const now = Date.now();
|
|
926
|
+
const alert = {
|
|
927
|
+
id: alertId,
|
|
928
|
+
category: runnerCategoryOf(record.state),
|
|
929
|
+
severity: rendered.severity,
|
|
930
|
+
title: rendered.title,
|
|
931
|
+
message: rendered.message,
|
|
932
|
+
status: "active",
|
|
933
|
+
read: previous !== null && previous.state === record.state ? existing?.read === true : false,
|
|
934
|
+
createdAt: previous !== null ? existing?.createdAt ?? now : now,
|
|
935
|
+
updatedAt: now,
|
|
936
|
+
source: event.source ? {
|
|
937
|
+
type: event.source.type,
|
|
938
|
+
id: String(event.source.id)
|
|
939
|
+
} : {
|
|
940
|
+
type: "runner",
|
|
941
|
+
id: record.runnerId
|
|
942
|
+
},
|
|
943
|
+
action: ADDONS_PAGE_ACTION,
|
|
944
|
+
metadata: { runner: record }
|
|
945
|
+
};
|
|
946
|
+
await this.persistAlert(alert);
|
|
947
|
+
if (previous === null) this.emitAlertCreatedEvent(alert);
|
|
948
|
+
else this.emitAlertUpdatedEvent(alertId, {
|
|
949
|
+
message: alert.message,
|
|
950
|
+
title: alert.title
|
|
951
|
+
});
|
|
952
|
+
await this.enforceMaxAlerts();
|
|
953
|
+
}
|
|
954
|
+
/**
|
|
955
|
+
* A runner reached `running`: its episode is over. Close the runner alert so a
|
|
956
|
+
* later failure opens a NEW episode, instead of folding into a stale
|
|
957
|
+
* `refused` record whose notification was already sent.
|
|
958
|
+
*/
|
|
959
|
+
async handleRunnerStateChanged(event) {
|
|
960
|
+
if (event.data["state"] !== "running") return;
|
|
961
|
+
const runnerId = typeof event.data["runnerId"] === "string" ? event.data["runnerId"] : null;
|
|
962
|
+
if (runnerId === null) return;
|
|
963
|
+
const alertId = runnerAlertId(typeof event.data["nodeId"] === "string" ? event.data["nodeId"] : "hub", runnerId);
|
|
964
|
+
if (await this.readRunnerRecord(alertId) === null) return;
|
|
965
|
+
await this.dismiss(alertId);
|
|
966
|
+
}
|
|
967
|
+
/** The node's one-shot runner boot check: one alert, dismissed when the node is clean. */
|
|
968
|
+
async handleRunnerCheck(event) {
|
|
969
|
+
const nodeId = typeof event.data["nodeId"] === "string" ? event.data["nodeId"] : "hub";
|
|
970
|
+
const alertId = `runner-check:${nodeId}`;
|
|
971
|
+
if (event.data["degraded"] !== true) {
|
|
972
|
+
await this.dismiss(alertId);
|
|
973
|
+
return;
|
|
974
|
+
}
|
|
975
|
+
const summary = typeof event.data["summary"] === "string" ? event.data["summary"] : "degraded";
|
|
976
|
+
const ids = (value) => Array.isArray(value) ? value.filter((v) => typeof v === "string") : [];
|
|
977
|
+
const refusedIds = Array.isArray(event.data["refused"]) ? event.data["refused"].flatMap((r) => {
|
|
978
|
+
const id = typeof r === "object" && r !== null ? r["runnerId"] : void 0;
|
|
979
|
+
return typeof id === "string" ? [id] : [];
|
|
980
|
+
}) : [];
|
|
981
|
+
const failedIds = ids(event.data["failed"]);
|
|
982
|
+
const missingIds = ids(event.data["missing"]);
|
|
983
|
+
const parts = [
|
|
984
|
+
...failedIds.length > 0 ? [`failed: ${failedIds.join(", ")}`] : [],
|
|
985
|
+
...refusedIds.length > 0 ? [`refused: ${refusedIds.join(", ")}`] : [],
|
|
986
|
+
...missingIds.length > 0 ? [`missing: ${missingIds.join(", ")}`] : []
|
|
987
|
+
];
|
|
988
|
+
const now = Date.now();
|
|
989
|
+
const existing = await this.readAlertRaw(alertId);
|
|
990
|
+
const alert = {
|
|
991
|
+
id: alertId,
|
|
992
|
+
category: "system.runner-check",
|
|
993
|
+
severity: "critical",
|
|
994
|
+
title: "Runners degraded",
|
|
995
|
+
message: `${nodeId}: ${summary}${parts.length > 0 ? ` (${parts.join("; ")})` : ""}`,
|
|
996
|
+
action: ADDONS_PAGE_ACTION,
|
|
997
|
+
status: "active",
|
|
998
|
+
read: false,
|
|
999
|
+
createdAt: existing?.createdAt ?? now,
|
|
1000
|
+
updatedAt: now,
|
|
1001
|
+
source: {
|
|
1002
|
+
type: "node",
|
|
1003
|
+
id: nodeId
|
|
1004
|
+
},
|
|
1005
|
+
metadata: {
|
|
1006
|
+
nodeId,
|
|
1007
|
+
failed: event.data["failed"],
|
|
1008
|
+
refused: event.data["refused"],
|
|
1009
|
+
missing: event.data["missing"]
|
|
1010
|
+
}
|
|
1011
|
+
};
|
|
1012
|
+
await this.persistAlert(alert);
|
|
1013
|
+
this.emitAlertCreatedEvent(alert);
|
|
1014
|
+
}
|
|
1015
|
+
async readAlertRaw(alertId) {
|
|
1016
|
+
const store = this.alertStore;
|
|
1017
|
+
if (store === null) return null;
|
|
1018
|
+
const raw = await store.getData(alertId);
|
|
1019
|
+
if (raw === null) return null;
|
|
1020
|
+
const rec = Object.fromEntries(Object.entries(raw));
|
|
1021
|
+
const meta = rec["metadata"];
|
|
1022
|
+
const metadata = typeof meta === "object" && meta !== null && !Array.isArray(meta) ? meta : void 0;
|
|
1023
|
+
const parsed = AlertSchema.safeParse({
|
|
1024
|
+
id: alertId,
|
|
1025
|
+
...rec
|
|
1026
|
+
});
|
|
1027
|
+
return {
|
|
1028
|
+
...typeof rec["createdAt"] === "number" ? { createdAt: rec["createdAt"] } : {},
|
|
1029
|
+
...typeof rec["read"] === "boolean" ? { read: rec["read"] } : {},
|
|
1030
|
+
...typeof rec["status"] === "string" ? { status: rec["status"] } : {},
|
|
1031
|
+
...episodeKeyFromMetadata(metadata) !== void 0 ? { episodeKey: episodeKeyFromMetadata(metadata) } : {},
|
|
1032
|
+
...parsed.success ? { episode: episodeViewOf(parsed.data) } : {}
|
|
1033
|
+
};
|
|
1034
|
+
}
|
|
1035
|
+
async handleModelDownload(event) {
|
|
1036
|
+
const data = event.data;
|
|
1037
|
+
const modelId = data.modelId ?? "unknown";
|
|
1038
|
+
const progress = data.progress ?? 0;
|
|
1039
|
+
const stableId = `model-download:${modelId}`;
|
|
1040
|
+
const store = this.alertStore;
|
|
1041
|
+
if (store === null) return;
|
|
1042
|
+
if (await store.getData(stableId) !== null) {
|
|
1043
|
+
const now = Date.now();
|
|
1044
|
+
if (progress >= 100) {
|
|
1045
|
+
await this.mergeUpdate(stableId, {
|
|
1046
|
+
status: "completed",
|
|
1047
|
+
progress: 100,
|
|
1048
|
+
message: `Model "${modelId}" download completed`,
|
|
1049
|
+
updatedAt: now
|
|
1050
|
+
});
|
|
1051
|
+
this.emitAlertUpdatedEvent(stableId, {
|
|
1052
|
+
status: "completed",
|
|
1053
|
+
progress: 100
|
|
1054
|
+
});
|
|
1055
|
+
} else if (progress < 0) {
|
|
1056
|
+
await this.mergeUpdate(stableId, {
|
|
1057
|
+
status: "failed",
|
|
1058
|
+
message: `Model "${modelId}" download failed`,
|
|
1059
|
+
updatedAt: now
|
|
1060
|
+
});
|
|
1061
|
+
this.emitAlertUpdatedEvent(stableId, { status: "failed" });
|
|
1062
|
+
} else {
|
|
1063
|
+
await this.mergeUpdate(stableId, {
|
|
1064
|
+
progress,
|
|
1065
|
+
message: `Downloading model "${modelId}" — ${String(Math.round(progress))}%`,
|
|
1066
|
+
updatedAt: now
|
|
1067
|
+
});
|
|
1068
|
+
this.emitAlertUpdatedEvent(stableId, { progress });
|
|
1069
|
+
}
|
|
1070
|
+
} else {
|
|
1071
|
+
const alert = {
|
|
1072
|
+
id: stableId,
|
|
1073
|
+
category: EventCategory.ModelDownloadProgress,
|
|
1074
|
+
severity: "info",
|
|
1075
|
+
title: "Model download",
|
|
1076
|
+
message: `Downloading model "${modelId}" — ${String(Math.round(progress))}%`,
|
|
1077
|
+
status: "in-progress",
|
|
1078
|
+
progress,
|
|
1079
|
+
read: false,
|
|
1080
|
+
createdAt: Date.now(),
|
|
1081
|
+
updatedAt: Date.now(),
|
|
1082
|
+
source: event.source ? {
|
|
1083
|
+
type: event.source.type,
|
|
1084
|
+
id: String(event.source.id)
|
|
1085
|
+
} : void 0,
|
|
1086
|
+
metadata: { modelId }
|
|
1087
|
+
};
|
|
1088
|
+
await this.persistAlert(alert);
|
|
1089
|
+
this.emitAlertCreatedEvent(alert);
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
/**
|
|
1093
|
+
* `[ALERT-CENTER-EVENTS]` — rate limit a `(category, source.id)`
|
|
1094
|
+
* tuple. Returns `true` when the caller should DROP this event
|
|
1095
|
+
* without persisting an alert, and `false` when the alert should
|
|
1096
|
+
* proceed normally.
|
|
1097
|
+
*
|
|
1098
|
+
* Heuristic: the first `RATE_LIMIT_MAX_PER_SOURCE` events within a
|
|
1099
|
+
* `RATE_LIMIT_WINDOW_MS` window go through. Once the threshold is
|
|
1100
|
+
* crossed, subsequent events are suppressed until the window rolls
|
|
1101
|
+
* over. When the threshold is first crossed, the suppression is
|
|
1102
|
+
* logged once so operators know why they're not seeing the follow-
|
|
1103
|
+
* up alerts; after the window rolls over the next event is
|
|
1104
|
+
* un-suppressed and starts a new window.
|
|
1105
|
+
*/
|
|
1106
|
+
shouldSuppressByRate(category, event) {
|
|
1107
|
+
const sourceId = event.source?.id ?? "unknown";
|
|
1108
|
+
const key = `${category}::${sourceId}`;
|
|
1109
|
+
const now = Date.now();
|
|
1110
|
+
const entry = this.rateLimitCounters.get(key);
|
|
1111
|
+
if (!entry || now - entry.firstAt > RATE_LIMIT_WINDOW_MS) {
|
|
1112
|
+
this.rateLimitCounters.set(key, {
|
|
1113
|
+
firstAt: now,
|
|
1114
|
+
count: 1,
|
|
1115
|
+
suppressedLogged: false
|
|
1116
|
+
});
|
|
1117
|
+
return false;
|
|
1118
|
+
}
|
|
1119
|
+
entry.count += 1;
|
|
1120
|
+
if (entry.count <= RATE_LIMIT_MAX_PER_SOURCE) return false;
|
|
1121
|
+
if (!entry.suppressedLogged) {
|
|
1122
|
+
entry.suppressedLogged = true;
|
|
1123
|
+
this.ctx.logger?.info("rate-limiting suppressing remainder of window", { meta: {
|
|
1124
|
+
category,
|
|
1125
|
+
sourceId,
|
|
1126
|
+
maxPerSource: RATE_LIMIT_MAX_PER_SOURCE,
|
|
1127
|
+
windowSeconds: RATE_LIMIT_WINDOW_MS / 1e3
|
|
1128
|
+
} });
|
|
1129
|
+
}
|
|
1130
|
+
return true;
|
|
1131
|
+
}
|
|
1132
|
+
/**
|
|
1133
|
+
* AddonLoadFailed — kernel's AddonHealthMonitor has post-grace
|
|
1134
|
+
* failed an addon load/init. Upsert a stable-id alert keyed by
|
|
1135
|
+
* `addon-load-failed:<packageName>` so the recovery path can
|
|
1136
|
+
* dismiss it. Severity=error, persistent until dismissed or
|
|
1137
|
+
* auto-resolved.
|
|
1138
|
+
*
|
|
1139
|
+
* The action `retry` carries the package name so the admin UI can
|
|
1140
|
+
* dispatch `addons.retryLoad(packageName)` directly from the alert
|
|
1141
|
+
* card without the operator opening the Addons page.
|
|
1142
|
+
*/
|
|
1143
|
+
async handleAddonLoadFailed(event) {
|
|
1144
|
+
const data = event.data;
|
|
1145
|
+
const packageName = String(data["packageName"] ?? "");
|
|
1146
|
+
if (!packageName) return;
|
|
1147
|
+
const addonId = data["addonId"];
|
|
1148
|
+
const errorObj = data["error"];
|
|
1149
|
+
const retryCount = Number(data["retryCount"] ?? 0);
|
|
1150
|
+
const nextRetryAt = data["nextRetryAt"];
|
|
1151
|
+
const stableId = `addon-load-failed:${packageName}`;
|
|
1152
|
+
const message = errorObj?.message ? `${addonId ? `${addonId} — ` : ""}${errorObj.message}` : `Addon ${addonId ?? packageName} failed to load`;
|
|
1153
|
+
const alert = {
|
|
1154
|
+
id: stableId,
|
|
1155
|
+
category: EventCategory.AddonLoadFailed,
|
|
1156
|
+
severity: "error",
|
|
1157
|
+
title: `Addon failed: ${addonId ?? packageName}`,
|
|
1158
|
+
message,
|
|
1159
|
+
status: "active",
|
|
1160
|
+
read: false,
|
|
1161
|
+
createdAt: Date.now(),
|
|
1162
|
+
updatedAt: Date.now(),
|
|
1163
|
+
source: {
|
|
1164
|
+
type: "addon",
|
|
1165
|
+
id: packageName
|
|
1166
|
+
},
|
|
1167
|
+
metadata: {
|
|
1168
|
+
packageName,
|
|
1169
|
+
addonId,
|
|
1170
|
+
retryCount,
|
|
1171
|
+
nextRetryAt,
|
|
1172
|
+
stack: errorObj?.stack
|
|
1173
|
+
}
|
|
1174
|
+
};
|
|
1175
|
+
await this.emitAlert(alert);
|
|
1176
|
+
}
|
|
1177
|
+
/**
|
|
1178
|
+
* AddonLoadRecovered — addon previously alerting is back to healthy.
|
|
1179
|
+
* Dismiss the matching alert so the operator's badge count drops.
|
|
1180
|
+
*/
|
|
1181
|
+
async handleAddonLoadRecovered(event) {
|
|
1182
|
+
const data = event.data;
|
|
1183
|
+
const packageName = String(data["packageName"] ?? "");
|
|
1184
|
+
if (!packageName) return;
|
|
1185
|
+
const stableId = `addon-load-failed:${packageName}`;
|
|
1186
|
+
try {
|
|
1187
|
+
await this.dismiss(stableId);
|
|
1188
|
+
} catch (err) {
|
|
1189
|
+
this.ctx.logger?.debug("AddonLoadRecovered: dismiss failed (likely already dismissed)", { meta: {
|
|
1190
|
+
stableId,
|
|
1191
|
+
error: errMsg(err)
|
|
1192
|
+
} });
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
/**
|
|
1196
|
+
* SystemLivenessFailed — a liveness invariant of this node is false.
|
|
1197
|
+
*
|
|
1198
|
+
* `findingId` is already stable across ticks (`liveness:no-devices`,
|
|
1199
|
+
* `liveness:no-footage:<deviceId>`, …), so it IS the alert id: an ongoing
|
|
1200
|
+
* fault updates one alert instead of producing one every five minutes.
|
|
1201
|
+
*/
|
|
1202
|
+
async handleLivenessFailed(event) {
|
|
1203
|
+
const data = event.data;
|
|
1204
|
+
const findingId = String(data["findingId"] ?? "");
|
|
1205
|
+
if (!findingId) return;
|
|
1206
|
+
const deviceId = typeof data["deviceId"] === "number" ? data["deviceId"] : void 0;
|
|
1207
|
+
const severity = data["severity"] === "warning" ? "warning" : "error";
|
|
1208
|
+
const alert = {
|
|
1209
|
+
id: findingId,
|
|
1210
|
+
category: EventCategory.SystemLivenessFailed,
|
|
1211
|
+
severity,
|
|
1212
|
+
title: String(data["title"] ?? "Node liveness"),
|
|
1213
|
+
message: String(data["message"] ?? ""),
|
|
1214
|
+
status: "active",
|
|
1215
|
+
read: false,
|
|
1216
|
+
createdAt: Date.now(),
|
|
1217
|
+
updatedAt: Date.now(),
|
|
1218
|
+
source: {
|
|
1219
|
+
type: "liveness",
|
|
1220
|
+
id: findingId
|
|
1221
|
+
},
|
|
1222
|
+
metadata: {
|
|
1223
|
+
findingId,
|
|
1224
|
+
...deviceId !== void 0 ? { deviceId } : {}
|
|
1225
|
+
}
|
|
1226
|
+
};
|
|
1227
|
+
await this.emitAlert(alert);
|
|
1228
|
+
}
|
|
1229
|
+
/** SystemLivenessRecovered — the invariant holds again; drop the alert. */
|
|
1230
|
+
async handleLivenessRecovered(event) {
|
|
1231
|
+
const findingId = String(event.data["findingId"] ?? "");
|
|
1232
|
+
if (!findingId) return;
|
|
1233
|
+
try {
|
|
1234
|
+
await this.dismiss(findingId);
|
|
1235
|
+
} catch (err) {
|
|
1236
|
+
this.ctx.logger?.debug("LivenessRecovered: dismiss failed (likely already dismissed)", { meta: {
|
|
1237
|
+
findingId,
|
|
1238
|
+
error: errMsg(err)
|
|
1239
|
+
} });
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
/**
|
|
1243
|
+
* Stream offline — ONLY an outage reason counts: `stale-timeout`, or one of
|
|
1244
|
+
* the battery failures (`wake-timeout`, `connection-error`,
|
|
1245
|
+
* `battery-unreachable`). Suspend / destroy / idle dial are deliberate and
|
|
1246
|
+
* must not ring the bell (same gate NC uses). One card per DEVICE (D883).
|
|
1247
|
+
*/
|
|
1248
|
+
async handleStreamOffline(event) {
|
|
1249
|
+
const reason = event.data["reason"];
|
|
1250
|
+
if (typeof reason !== "string" || !STREAM_OUTAGE_REASONS.includes(reason)) return;
|
|
1251
|
+
const deviceId = event.data["deviceId"];
|
|
1252
|
+
const camStreamId = event.data["camStreamId"];
|
|
1253
|
+
if (typeof deviceId !== "number") return;
|
|
1254
|
+
const camStreamIds = streamIdsOf(event.data["camStreamIds"], typeof camStreamId === "string" ? camStreamId : void 0);
|
|
1255
|
+
const name = await this.resolveDeviceName(deviceId);
|
|
1256
|
+
const label = name ?? `Camera ${String(deviceId)}`;
|
|
1257
|
+
const alert = {
|
|
1258
|
+
id: `stream-offline:${String(deviceId)}`,
|
|
1259
|
+
category: EventCategory.StreamOffline,
|
|
1260
|
+
severity: "warning",
|
|
1261
|
+
title: "Stream offline",
|
|
1262
|
+
message: `${label} — ${camStreamIds.length > 0 ? camStreamIds.join(", ") : "its stream"} stopped sending video (${reason}).`,
|
|
1263
|
+
status: "active",
|
|
1264
|
+
read: false,
|
|
1265
|
+
createdAt: Date.now(),
|
|
1266
|
+
updatedAt: Date.now(),
|
|
1267
|
+
source: {
|
|
1268
|
+
type: "device",
|
|
1269
|
+
id: String(deviceId)
|
|
1270
|
+
},
|
|
1271
|
+
metadata: {
|
|
1272
|
+
deviceId,
|
|
1273
|
+
camStreamId,
|
|
1274
|
+
camStreamIds,
|
|
1275
|
+
reason,
|
|
1276
|
+
...name !== void 0 ? { name } : {}
|
|
1277
|
+
}
|
|
1278
|
+
};
|
|
1279
|
+
await this.emitAlert(alert);
|
|
1280
|
+
}
|
|
1281
|
+
/**
|
|
1282
|
+
* A notification rule that cannot work (D905) — visible in-app even when no
|
|
1283
|
+
* rule listens for `rule-broken`. One card per RULE; a new reason updates it.
|
|
1284
|
+
*/
|
|
1285
|
+
async handleRuleBroken(event) {
|
|
1286
|
+
const ruleId = event.data["ruleId"];
|
|
1287
|
+
if (typeof ruleId !== "string" || ruleId.length === 0) return;
|
|
1288
|
+
const ruleName = typeof event.data["ruleName"] === "string" ? event.data["ruleName"] : ruleId;
|
|
1289
|
+
const reason = typeof event.data["reason"] === "string" ? event.data["reason"] : "unknown";
|
|
1290
|
+
const listed = event.data["offendingIds"];
|
|
1291
|
+
const offendingIds = Array.isArray(listed) ? listed.filter((id) => typeof id === "string") : [];
|
|
1292
|
+
const what = reason === "unparseable" ? "cannot be loaded and sends nothing — open it and save it again" : reason === "device-deleted" ? `still names a deleted device (${offendingIds.join(", ")}) and was switched off` : reason === "target-deleted" ? `still sends to a deleted destination (${offendingIds.join(", ")}) and was switched off` : "cannot work";
|
|
1293
|
+
const alert = {
|
|
1294
|
+
id: `nc-rule-broken:${ruleId}`,
|
|
1295
|
+
category: EventCategory.NotificationRuleBroken,
|
|
1296
|
+
severity: "warning",
|
|
1297
|
+
title: "Notification rule broken",
|
|
1298
|
+
message: `Rule "${ruleName}" ${what}.`,
|
|
1299
|
+
status: "active",
|
|
1300
|
+
read: false,
|
|
1301
|
+
createdAt: Date.now(),
|
|
1302
|
+
updatedAt: Date.now(),
|
|
1303
|
+
source: {
|
|
1304
|
+
type: "addon",
|
|
1305
|
+
id: "notification-center"
|
|
1306
|
+
},
|
|
1307
|
+
metadata: {
|
|
1308
|
+
ruleId,
|
|
1309
|
+
ruleName,
|
|
1310
|
+
reason,
|
|
1311
|
+
offendingIds,
|
|
1312
|
+
reasons: event.data["reasons"]
|
|
1313
|
+
}
|
|
1314
|
+
};
|
|
1315
|
+
await this.emitAlert(alert);
|
|
1316
|
+
}
|
|
1317
|
+
/**
|
|
1318
|
+
* One card per faulted migration, from the ledger (D987, D11): the RPC read is
|
|
1319
|
+
* the authority and an event only says it may have changed. A read that fails
|
|
1320
|
+
* changes nothing — it must never dismiss a card (D49).
|
|
1321
|
+
*/
|
|
1322
|
+
async reconcileMigrationAlerts() {
|
|
1323
|
+
try {
|
|
1324
|
+
const { entries } = await this.ctx.api.migrations.listLedger.query({});
|
|
1325
|
+
const plan = planMigrationAlerts(entries, await this.listAlerts(), Date.now());
|
|
1326
|
+
for (const alert of plan.raise) await this.emitAlert(alert);
|
|
1327
|
+
for (const alertId of plan.dismiss) await this.dismiss(alertId);
|
|
1328
|
+
} catch (err) {
|
|
1329
|
+
this.ctx.logger.warn("migration alerts: reconcile skipped, the ledger could not be read", { meta: { error: errMsg(err) } });
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
/** The rule works again — drop its broken-rule card. */
|
|
1333
|
+
async handleRuleRepaired(event) {
|
|
1334
|
+
const ruleId = event.data["ruleId"];
|
|
1335
|
+
if (typeof ruleId !== "string" || ruleId.length === 0) return;
|
|
1336
|
+
const stableId = `nc-rule-broken:${ruleId}`;
|
|
1337
|
+
try {
|
|
1338
|
+
await this.dismiss(stableId);
|
|
1339
|
+
} catch (err) {
|
|
1340
|
+
this.ctx.logger?.debug("NotificationRuleRepaired: dismiss failed (likely already dismissed)", { meta: {
|
|
1341
|
+
stableId,
|
|
1342
|
+
error: errMsg(err)
|
|
1343
|
+
} });
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
/** Stream online after an outage — drop the matching offline card. */
|
|
1347
|
+
async handleStreamOnline(event) {
|
|
1348
|
+
const deviceId = event.data["deviceId"];
|
|
1349
|
+
if (typeof deviceId !== "number") return;
|
|
1350
|
+
const stableId = `stream-offline:${String(deviceId)}`;
|
|
1351
|
+
await this.dismissLegacyStreamCards(deviceId);
|
|
1352
|
+
try {
|
|
1353
|
+
await this.dismiss(stableId);
|
|
1354
|
+
} catch (err) {
|
|
1355
|
+
this.ctx.logger?.debug("StreamOnline: dismiss failed (likely already dismissed)", { meta: {
|
|
1356
|
+
stableId,
|
|
1357
|
+
error: errMsg(err)
|
|
1358
|
+
} });
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
/**
|
|
1362
|
+
* Dismiss the pre-D883 per-cam-stream cards (`stream-offline:<deviceId>:<stream>`)
|
|
1363
|
+
* of one device, or of every device when none is named. They can never meet
|
|
1364
|
+
* their `stream.online` under the per-device id.
|
|
1365
|
+
*/
|
|
1366
|
+
async dismissLegacyStreamCards(deviceId) {
|
|
1367
|
+
try {
|
|
1368
|
+
const pattern = deviceId === void 0 ? /^stream-offline:\d+:.+/ : new RegExp(`^stream-offline:${String(deviceId)}:.+`);
|
|
1369
|
+
for (const alert of await this.listAlerts({ limit: 1e3 })) if (alert.status === "active" && pattern.test(alert.id)) await this.dismiss(alert.id);
|
|
1370
|
+
} catch (err) {
|
|
1371
|
+
this.ctx.logger?.debug("legacy stream cards: sweep failed", { meta: { error: errMsg(err) } });
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
async resolveDeviceName(deviceId) {
|
|
1375
|
+
try {
|
|
1376
|
+
const device = await this.ctx.api.deviceManager.getDevice.query({ deviceId });
|
|
1377
|
+
if (device !== null && typeof device.name === "string" && device.name.trim().length > 0) return device.name.trim();
|
|
1378
|
+
} catch (err) {
|
|
1379
|
+
this.ctx.logger?.debug("resolveDeviceName failed", {
|
|
1380
|
+
tags: { deviceId },
|
|
1381
|
+
meta: { error: errMsg(err) }
|
|
1382
|
+
});
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1385
|
+
buildMessage(category, data, sourceId) {
|
|
1386
|
+
const addonId = data.addonId ?? sourceId;
|
|
1387
|
+
const device = deviceLabelFromEventData(data);
|
|
1388
|
+
const error = data.error;
|
|
1389
|
+
const processId = data.processId;
|
|
1390
|
+
switch (category) {
|
|
1391
|
+
case "addon.crashed": return `Addon "${addonId ?? "unknown"}" crashed${error ? `: ${error}` : ""}`;
|
|
1392
|
+
case "addon.runner-failed": {
|
|
1393
|
+
const runnerId = typeof data.runnerId === "string" ? data.runnerId : "unknown";
|
|
1394
|
+
const addonIds = Array.isArray(data.addonIds) ? data.addonIds.filter((x) => typeof x === "string").join(", ") : "";
|
|
1395
|
+
return `Runner "${runnerId}" gave up${addonIds.length > 0 ? ` (addons: ${addonIds})` : ""}`;
|
|
1396
|
+
}
|
|
1397
|
+
case "addon.error": return `Addon "${addonId ?? "unknown"}" error${error ? `: ${error}` : ""}`;
|
|
1398
|
+
case "addon.installed": return `Addon "${addonId ?? "unknown"}" installed`;
|
|
1399
|
+
case "addon.updated": {
|
|
1400
|
+
const from = data.fromVersion;
|
|
1401
|
+
const to = data.toVersion;
|
|
1402
|
+
return `Addon "${typeof data.packageName === "string" && data.packageName.length > 0 ? data.packageName : addonId ?? "unknown"}" updated${from && to ? ` from ${from} to ${to}` : to ? ` to ${to}` : ""}`;
|
|
1403
|
+
}
|
|
1404
|
+
case "addon.uninstalled": return `Addon "${addonId ?? "unknown"}" uninstalled`;
|
|
1405
|
+
case "device.unregistered": return `Device "${device}" unregistered`;
|
|
1406
|
+
case "agent.offline": return `Agent "${data.agentId ?? data.nodeId ?? "unknown"}" disconnected${data.reason ? `: ${String(data.reason)}` : ""}`;
|
|
1407
|
+
case "backup.restored": return `Backup restored${data.source ? ` from ${String(data.source)}` : ""}`;
|
|
1408
|
+
case "notification.failed": return `Notification failed${error ? `: ${error}` : ""}`;
|
|
1409
|
+
case "system.restarting": return `System restarting${data.reason ? ` — ${String(data.reason)}` : ""}`;
|
|
1410
|
+
case "system.restart-completed": {
|
|
1411
|
+
const pkg = typeof data.packageName === "string" ? data.packageName : void 0;
|
|
1412
|
+
const to = typeof data.toVersion === "string" ? data.toVersion : void 0;
|
|
1413
|
+
const kind = typeof data.kind === "string" ? data.kind : "restart";
|
|
1414
|
+
if (pkg !== void 0 && to !== void 0) return `${pkg} is now ${to}`;
|
|
1415
|
+
return `Node restart completed (${kind})`;
|
|
1416
|
+
}
|
|
1417
|
+
case "update.available": {
|
|
1418
|
+
const pkg = typeof data.packageName === "string" ? data.packageName : "package";
|
|
1419
|
+
const latest = typeof data.latestVersion === "string" ? data.latestVersion : "?";
|
|
1420
|
+
const node = typeof data.nodeId === "string" ? data.nodeId : void 0;
|
|
1421
|
+
return `${pkg} ${latest} available${node !== void 0 ? ` on ${node}` : ""}`;
|
|
1422
|
+
}
|
|
1423
|
+
case "recording.error": return `Recording error on "${device}"${error ? `: ${error}` : ""}`;
|
|
1424
|
+
case "recording.storage.critical": return `Storage critical for "${device}"`;
|
|
1425
|
+
case "system.tls-cert-changed": return data.caRotated === true ? `TLS certificate reissued (${String(data.reason)}) — the local CA also changed. Re-install ${String(data.caCertPath)} on any device that trusted the old one.` : `TLS certificate reissued (${String(data.reason)}) — the local CA is unchanged, previously trusted devices keep working.`;
|
|
1426
|
+
case "process.crashed": return `Process "${processId ?? "unknown"}" crashed`;
|
|
1427
|
+
default: return `Event: ${category}`;
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
async emitAlert(alert) {
|
|
1431
|
+
const existingRaw = await this.readAlertRaw(alert.id);
|
|
1432
|
+
const toStore = mergeEmitAlert({
|
|
1433
|
+
existing: existingRaw === null ? null : {
|
|
1434
|
+
read: existingRaw.read,
|
|
1435
|
+
episodeKey: existingRaw.episodeKey,
|
|
1436
|
+
status: existingRaw.status
|
|
1437
|
+
},
|
|
1438
|
+
incoming: alert
|
|
1439
|
+
});
|
|
1440
|
+
const isNew = existingRaw === null;
|
|
1441
|
+
const stored = await this.persistAlert(toStore);
|
|
1442
|
+
if (isNew) this.emitAlertCreatedEvent(stored);
|
|
1443
|
+
else this.emitAlertUpdatedEvent(alert.id, stored);
|
|
1444
|
+
await this.enforceMaxAlerts();
|
|
1445
|
+
await this.enforceRetention();
|
|
1446
|
+
}
|
|
1447
|
+
async updateAlert(alertId, patch) {
|
|
1448
|
+
await this.mergeUpdate(alertId, {
|
|
1449
|
+
...patch,
|
|
1450
|
+
updatedAt: Date.now()
|
|
1451
|
+
});
|
|
1452
|
+
this.emitAlertUpdatedEvent(alertId, patch);
|
|
1453
|
+
}
|
|
1454
|
+
/**
|
|
1455
|
+
* Read-merge-write: SettingsBackend.update() replaces the entire `data` blob,
|
|
1456
|
+
* so we must read the existing record, merge the patch, and write back.
|
|
1457
|
+
*/
|
|
1458
|
+
/** Alert writes (stamp + store + announce) from any caller, one at a time. */
|
|
1459
|
+
writeChain = Promise.resolve();
|
|
1460
|
+
serializedWrite(write) {
|
|
1461
|
+
const run = this.writeChain.then(write, write);
|
|
1462
|
+
this.writeChain = run.catch(() => void 0);
|
|
1463
|
+
return run;
|
|
1464
|
+
}
|
|
1465
|
+
mergeUpdate(id, patch) {
|
|
1466
|
+
return this.serializedWrite(() => this.mergeUpdateNow(id, patch));
|
|
1467
|
+
}
|
|
1468
|
+
async mergeUpdateNow(id, patch) {
|
|
1469
|
+
const store = this.alertStore;
|
|
1470
|
+
if (store === null) return;
|
|
1471
|
+
const previous = (await this.readAlertRaw(id))?.episode ?? null;
|
|
1472
|
+
const metadata = patch["metadata"];
|
|
1473
|
+
const keepEpisode = previous !== null && typeof metadata === "object" && metadata !== null ? { metadata: {
|
|
1474
|
+
...metadata,
|
|
1475
|
+
episodeId: previous.episodeId
|
|
1476
|
+
} } : {};
|
|
1477
|
+
await store.mergeUpdate(id, {
|
|
1478
|
+
...patch,
|
|
1479
|
+
...keepEpisode
|
|
1480
|
+
});
|
|
1481
|
+
const after = await store.getData(id);
|
|
1482
|
+
const parsed = after === null ? null : AlertSchema.safeParse({
|
|
1483
|
+
id,
|
|
1484
|
+
...after
|
|
1485
|
+
});
|
|
1486
|
+
if (parsed?.success === true) this.announceEpisode(previous, parsed.data);
|
|
1487
|
+
}
|
|
1488
|
+
/**
|
|
1489
|
+
* Store an alert, stamping its episode identity. The stored alert is what a
|
|
1490
|
+
* caller must use afterwards, and the opening or closing of a critical/error
|
|
1491
|
+
* episode is announced here, in the one place every write passes through.
|
|
1492
|
+
*/
|
|
1493
|
+
persistAlert(alert) {
|
|
1494
|
+
return this.serializedWrite(() => this.persistAlertNow(alert));
|
|
1495
|
+
}
|
|
1496
|
+
async persistAlertNow(alert) {
|
|
1497
|
+
const store = this.alertStore;
|
|
1498
|
+
if (store === null) return alert;
|
|
1499
|
+
const previous = (await this.readAlertRaw(alert.id))?.episode ?? null;
|
|
1500
|
+
const episodeId = nextEpisodeId({
|
|
1501
|
+
alertId: alert.id,
|
|
1502
|
+
previous,
|
|
1503
|
+
incomingKey: episodeKeyFromMetadata(alert.metadata),
|
|
1504
|
+
now: Date.now()
|
|
1505
|
+
});
|
|
1506
|
+
const stamped = {
|
|
1507
|
+
...alert,
|
|
1508
|
+
metadata: {
|
|
1509
|
+
...alert.metadata,
|
|
1510
|
+
episodeId
|
|
1511
|
+
}
|
|
1512
|
+
};
|
|
1513
|
+
await store.persist(stamped);
|
|
1514
|
+
this.announceEpisode(previous, stamped);
|
|
1515
|
+
return stamped;
|
|
1516
|
+
}
|
|
1517
|
+
/**
|
|
1518
|
+
* Announce an episode edge on the bus. Telemetry, and it may be dropped
|
|
1519
|
+
* (D8): Notification Center reconciles from the alerts store (D11, D49).
|
|
1520
|
+
*/
|
|
1521
|
+
announceEpisode(previous, alert) {
|
|
1522
|
+
const edge = episodeEdge(previous, episodeViewOf(alert));
|
|
1523
|
+
if (edge === null) return;
|
|
1524
|
+
this.ctx.eventBus?.emit(createEvent(EventCategory.AlertEpisode, EVENT_SOURCE, alertEpisodePayload(alert, edge, Date.now())));
|
|
1525
|
+
}
|
|
1526
|
+
emitAlertCreatedEvent(alert) {
|
|
1527
|
+
this.ctx.eventBus?.emit(createEvent("alert.created", EVENT_SOURCE, {
|
|
1528
|
+
id: alert.id,
|
|
1529
|
+
category: alert.category,
|
|
1530
|
+
severity: alert.severity,
|
|
1531
|
+
title: alert.title,
|
|
1532
|
+
status: alert.status
|
|
1533
|
+
}));
|
|
1534
|
+
}
|
|
1535
|
+
emitAlertUpdatedEvent(alertId, patch) {
|
|
1536
|
+
const patchRecord = {};
|
|
1537
|
+
for (const [key, value] of Object.entries(patch)) patchRecord[key] = value;
|
|
1538
|
+
this.ctx.eventBus?.emit(createEvent("alert.updated", EVENT_SOURCE, {
|
|
1539
|
+
alertId,
|
|
1540
|
+
patch: patchRecord
|
|
1541
|
+
}));
|
|
1542
|
+
}
|
|
1543
|
+
async enforceMaxAlerts() {
|
|
1544
|
+
const store = this.alertStore;
|
|
1545
|
+
if (store === null) return;
|
|
1546
|
+
if (await store.countAll() <= this.config.maxAlerts) return;
|
|
1547
|
+
const all = await store.listAllByCreatedAtAsc();
|
|
1548
|
+
for (const id of selectOverflow(all.map(toPrunable), this.config.maxAlerts)) await store.delete(id);
|
|
1549
|
+
}
|
|
1550
|
+
async enforceRetention() {
|
|
1551
|
+
const store = this.alertStore;
|
|
1552
|
+
if (store === null) return;
|
|
1553
|
+
const cutoff = Date.now() - this.config.retentionDays * 24 * 60 * 60 * 1e3;
|
|
1554
|
+
const all = await store.listAllByCreatedAtAsc();
|
|
1555
|
+
for (const id of selectExpired(all.map(toPrunable), cutoff)) await store.delete(id);
|
|
1556
|
+
}
|
|
1557
|
+
};
|
|
1558
|
+
//#endregion
|
|
1559
|
+
export { AlertCenterAddon, AlertCenterAddon as default };
|