@camstack/server 1.2.928 → 1.2.929
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 +6 -0
- package/package.json +10 -8
- package/system/dist/addon-id-CVg1_r5E.mjs +39 -0
- package/system/dist/addon-id-Di0lNJ89.js +50 -0
- package/system/dist/addon-pages.cap-Df9FQwN1.js +49 -0
- package/system/dist/addon-pages.cap-DksUlE8j.mjs +44 -0
- package/system/dist/addon-settings.cap-3-TIIMq_.mjs +592 -0
- package/system/dist/addon-settings.cap-DAiE0Nb0.js +651 -0
- package/system/dist/addon-utils.mjs +1 -1
- package/system/dist/addon-widgets.cap-C4jxflbF.js +200 -0
- package/system/dist/addon-widgets.cap-D9m48X78.mjs +183 -0
- package/system/dist/base-addon-DD5dIfcZ.js +4624 -0
- package/system/dist/base-addon-Md14i7pe.mjs +4505 -0
- package/system/dist/base-device-2sL1DMm1.js +1103 -0
- package/system/dist/base-device-IuM1AwXZ.mjs +1098 -0
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +8 -6
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +6 -4
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +8 -6
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +7 -5
- package/system/dist/builtins/alerts/alerts.addon.js +113 -56
- package/system/dist/builtins/alerts/alerts.addon.mjs +60 -3
- package/system/dist/builtins/autotrack/index.js +21 -17
- package/system/dist/builtins/autotrack/index.mjs +5 -1
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +14 -11
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +8 -5
- package/system/dist/builtins/calendars/calendars.addon.js +8 -6
- package/system/dist/builtins/calendars/calendars.addon.mjs +3 -1
- package/system/dist/builtins/camera-grid/index.js +615 -58
- package/system/dist/builtins/camera-grid/index.mjs +558 -1
- package/system/dist/builtins/composer/composer.addon.js +788 -209
- package/system/dist/builtins/composer/composer.addon.mjs +583 -4
- package/system/dist/builtins/console-logging/index.js +4 -3
- package/system/dist/builtins/console-logging/index.mjs +2 -1
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +7887 -381
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +7511 -5
- package/system/dist/builtins/core-notifier/core-notifier.addon.js +731 -21
- package/system/dist/builtins/core-notifier/core-notifier.addon.mjs +711 -1
- package/system/dist/builtins/device-history/device-history.addon.js +110 -31
- package/system/dist/builtins/device-history/device-history.addon.mjs +81 -2
- package/system/dist/builtins/device-manager/device-manager.addon.js +12806 -227
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +12583 -5
- package/system/dist/builtins/hub-forwarder/index.js +4 -3
- package/system/dist/builtins/hub-forwarder/index.mjs +2 -1
- package/system/dist/builtins/keychain/index.js +31 -28
- package/system/dist/builtins/keychain/index.mjs +7 -4
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +15 -12
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +4 -1
- package/system/dist/builtins/local-auth/local-auth.addon.js +140 -39
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +106 -6
- package/system/dist/builtins/local-network/local-network.addon.js +43 -39
- package/system/dist/builtins/local-network/local-network.addon.mjs +7 -3
- package/system/dist/builtins/loki-logging/index.js +23 -17
- package/system/dist/builtins/loki-logging/index.mjs +7 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +156 -15
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +151 -10
- package/system/dist/builtins/platform-probe/index.js +25 -23
- package/system/dist/builtins/platform-probe/index.mjs +12 -10
- package/system/dist/builtins/record-entries/index.js +9 -7
- package/system/dist/builtins/record-entries/index.mjs +3 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +4 -4
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +97 -44
- package/system/dist/builtins/snapshot/index.mjs +54 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +5 -4
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +21 -20
- package/system/dist/builtins/sqlite-storage/index.js +1 -1
- package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +87 -61
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +29 -3
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +81 -72
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +10 -1
- package/system/dist/builtins/system-config/system-config.addon.js +17 -14
- package/system/dist/builtins/system-config/system-config.addon.mjs +118 -115
- package/system/dist/builtins/winston-logging/index.js +7 -5
- package/system/dist/builtins/winston-logging/index.mjs +3 -1
- package/system/dist/calendars.cap-CaFlShS9.js +155 -0
- package/system/dist/calendars.cap-_C4eD4fi.mjs +138 -0
- package/system/dist/camstack-error-DJ-TUAi1.js +23 -0
- package/system/dist/camstack-error-viZYfcj9.mjs +18 -0
- package/system/dist/cap-call-context-Bd76CbOW.js +95 -0
- package/system/dist/cap-call-context-DNwdgGSQ.mjs +78 -0
- package/system/dist/capability-definition-C2rJdVeX.mjs +177 -0
- package/system/dist/capability-definition-HCmTem8c.js +242 -0
- package/system/dist/{capture-engine-BcuwOSXv.js → capture-engine-DZ0LIUqA.js} +5 -4
- package/system/dist/{capture-engine-Bz7eXFjT.mjs → capture-engine-DiwbjoWp.mjs} +2 -1
- package/system/dist/command-origin-claim-Cief660O.js +35 -0
- package/system/dist/command-origin-claim-D1Wy7Qld.mjs +24 -0
- package/system/dist/composition-sources-Caqv7O7z.mjs +391 -0
- package/system/dist/composition-sources-CgnHjm8Q.js +408 -0
- package/system/dist/{constants-D2etJ02O.js → constants-Ba3FTIHl.js} +1 -1
- package/system/dist/constants-C860Y6U4.js +26 -0
- package/system/dist/{constants-BcUTQd1M.mjs → constants-DB4piTD5.mjs} +1 -1
- package/system/dist/constants-DCLpoF4L.mjs +21 -0
- package/system/dist/coral-accelerators-7o8hqvcN.js +564 -0
- package/system/dist/coral-accelerators-BKcXP59c.mjs +521 -0
- package/system/dist/core-blocks.cap-C6iKAZ-x.mjs +17986 -0
- package/system/dist/core-blocks.cap-LEMqVwxO.js +18705 -0
- package/system/dist/{custom-action-registry-N7flBDwT.mjs → custom-action-registry-B9zFBNVa.mjs} +37 -37
- package/system/dist/custom-actions-BFUSalC9.mjs +25 -0
- package/system/dist/custom-actions-D92NRi2c.js +36 -0
- package/system/dist/database-snapshot.cap-DF38e-0P.js +162 -0
- package/system/dist/database-snapshot.cap-dhrc9xnY.mjs +133 -0
- package/system/dist/declared-device-BWphj9WE.js +303 -0
- package/system/dist/declared-device-CKERA1Hi.mjs +286 -0
- package/system/dist/{device-ca-ExMN3xW3.mjs → device-ca-BLM6fccc.mjs} +2 -1
- package/system/dist/{device-ca-CU8zh9Pi.js → device-ca-C5kJE6mL.js} +7 -6
- package/system/dist/device-certificate-Cddm4Idn.mjs +91 -0
- package/system/dist/device-certificate-CguVACQO.js +162 -0
- package/system/dist/device-identifiers-BQg9EQi1.js +600 -0
- package/system/dist/device-identifiers-iSuQCKmK.mjs +529 -0
- package/system/dist/device-kind-BJ2pfsjw.mjs +78 -0
- package/system/dist/device-kind-CsSiv_YF.js +101 -0
- package/system/dist/device-manager.cap-2abwVLCM.js +2874 -0
- package/system/dist/device-manager.cap-CFZSPfUh.mjs +2749 -0
- package/system/dist/device-provider.cap-3Uvk6f5-.mjs +331 -0
- package/system/dist/device-provider.cap-D7TV2kVH.js +366 -0
- package/system/dist/{device-row-store-CeW_GWh9.mjs → device-row-store-YF3jtmkk.mjs} +4 -1
- package/system/dist/{device-row-store-BMIR-n3m.js → device-row-store-doTfMOqn.js} +12 -9
- package/system/dist/device-transitions.cap-B5w5PYU_.js +860 -0
- package/system/dist/device-transitions.cap-DojcwEuX.mjs +819 -0
- package/system/dist/device-type-CbQsnFdC.js +477 -0
- package/system/dist/device-type-DgEvK3ch.mjs +454 -0
- package/system/dist/entry-kind-D9MuVJCK.mjs +44 -0
- package/system/dist/entry-kind-cq90c--V.js +55 -0
- package/system/dist/error.cap-CSM_SRfR.mjs +3423 -0
- package/system/dist/error.cap-DBhgPeWK.js +3848 -0
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/history-catalog-BKRarIL_.js +831 -0
- package/system/dist/history-catalog-BwTeQ4Mr.mjs +802 -0
- package/system/dist/{hub-identity-Csxx2Q8k.js → hub-identity-BMdR3Mw9.js} +2 -2
- package/system/dist/{hub-identity-CYC1820R.mjs → hub-identity-DjMN9Ac2.mjs} +10 -10
- package/system/dist/{hub-mdns-ciao-By5577HM.js → hub-mdns-ciao--0v1TKME.js} +5 -5
- package/system/dist/{hub-mdns-ciao-CCDxM5qz.mjs → hub-mdns-ciao-DBrtHOcc.mjs} +2 -2
- package/system/dist/index.js +763 -151
- package/system/dist/index.mjs +832 -220
- package/system/dist/integration-instances.cap-Cl9O-k4h.mjs +538 -0
- package/system/dist/integration-instances.cap-dJIxg2_s.js +549 -0
- package/system/dist/keychain-admin.cap-Db_oFX4H.js +425 -0
- package/system/dist/keychain-admin.cap-GtM7gVGG.mjs +396 -0
- package/system/dist/l10n-Bu6aUvSY.mjs +10 -0
- package/system/dist/l10n-CGMvp7NF.js +15 -0
- package/system/dist/labels-DX5S8deC.js +81 -0
- package/system/dist/labels-DsBcU7md.mjs +64 -0
- package/system/dist/{legacy-integration-rows-door-CVwOo5aq.js → legacy-integration-rows-door-B1nzxxr5.js} +2 -2
- package/system/dist/{legacy-integration-rows-door-D9tQOUzh.mjs → legacy-integration-rows-door-nTvo_6jQ.mjs} +1 -1
- package/system/dist/log-destination.cap-CxZzAVaR.mjs +143 -0
- package/system/dist/log-destination.cap-DELPJkZ0.js +148 -0
- package/system/dist/low-power-sleep.cap-7lfVU41N.js +103 -0
- package/system/dist/low-power-sleep.cap-tGPmaZ_V.mjs +92 -0
- package/system/dist/mask-shape-Ci8Co9w0.mjs +57 -0
- package/system/dist/mask-shape-CmPA2fst.js +92 -0
- package/system/dist/metrics-provider.cap-BNmcHDkQ.mjs +405 -0
- package/system/dist/metrics-provider.cap-BcmQUt6l.js +410 -0
- package/system/dist/migration-BMjgkyG2.js +380 -0
- package/system/dist/migration-DRJAtdy7.mjs +321 -0
- package/system/dist/network-access.cap-B5TWLDCC.js +1099 -0
- package/system/dist/network-access.cap-BJnGbE6n.mjs +1004 -0
- package/system/dist/notification-rules.cap-B__YBgnG.js +3422 -0
- package/system/dist/notification-rules.cap-D9ArZlwx.mjs +3357 -0
- package/system/dist/ops-log-CB4pIdqi.mjs +64 -0
- package/system/dist/ops-log-pxt9176Z.js +81 -0
- package/system/dist/pinned-binary-BOhOSNff.js +28 -0
- package/system/dist/pinned-binary-CrIRAi4G.mjs +23 -0
- package/system/dist/platform-probe.cap-1WrMhWHx.js +250 -0
- package/system/dist/platform-probe.cap-BFeqFLtQ.mjs +233 -0
- package/system/dist/prefix-walk-B4b2-9aK.mjs +790 -0
- package/system/dist/prefix-walk-DC0ljmbB.js +843 -0
- package/system/dist/ptz-autotrack.cap-BW7w0zHD.js +229 -0
- package/system/dist/ptz-autotrack.cap-DT2GypXw.mjs +224 -0
- package/system/dist/quantity-D3g5SxsZ.mjs +114 -0
- package/system/dist/quantity-lY1KiTSZ.js +143 -0
- package/system/dist/raw-secret-migration-DxuBFtvi.js +50 -0
- package/system/dist/raw-secret-migration-iv88mLoc.mjs +39 -0
- package/system/dist/record-entries.cap-sMUhTvTU.mjs +75 -0
- package/system/dist/record-entries.cap-ti1C046R.js +80 -0
- package/system/dist/record-kind-DoBfYHCs.js +203 -0
- package/system/dist/record-kind-ub6NXqfh.mjs +162 -0
- package/system/dist/recording-archive.cap-7OrIn9e5.mjs +1299 -0
- package/system/dist/recording-archive.cap-D7bo-QSM.js +1328 -0
- package/system/dist/records.cap-ClcWV64i.js +329 -0
- package/system/dist/records.cap-CwLT2ByG.mjs +294 -0
- package/system/dist/relocate-CdVQAk-w.js +804 -0
- package/system/dist/relocate-CoZZTui1.mjs +661 -0
- package/system/dist/rename-composition-block-7WIICIDq.mjs +33525 -0
- package/system/dist/rename-composition-block-CcWLwVhG.js +34692 -0
- package/system/dist/{restore-archive-BJfyu0sG.mjs → restore-archive-CjAyKpgX.mjs} +96 -94
- package/system/dist/{restore-archive-CIFvqOze.js → restore-archive-CkTkv3Ss.js} +6 -4
- package/system/dist/scoped-settings-CylSSq_8.js +955 -0
- package/system/dist/scoped-settings-DVWUIP7Z.mjs +650 -0
- package/system/dist/server-name-BIhLuHvX.mjs +35 -0
- package/system/dist/server-name-OALNvpqC.js +52 -0
- package/system/dist/settings-store.cap-Ci4F2zul.mjs +569 -0
- package/system/dist/settings-store.cap-wlJhCspr.js +640 -0
- package/system/dist/snapshot.cap-3suPdBHV.js +250 -0
- package/system/dist/snapshot.cap-Bs8Oyaqh.mjs +245 -0
- package/system/dist/source-info-DGB7SdB_.mjs +190 -0
- package/system/dist/source-info-DtWf4k2j.js +225 -0
- package/system/dist/storage-admin.cap-BSv1NjKJ.mjs +883 -0
- package/system/dist/storage-admin.cap-he0OqvVM.js +906 -0
- package/system/dist/storage-location-CBT8GCD6.mjs +163 -0
- package/system/dist/storage-location-CTweDMZf.js +198 -0
- package/system/dist/storage-location-mode-B21UVRRX.mjs +167 -0
- package/system/dist/storage-location-mode-CS4sMzo-.js +232 -0
- package/system/dist/storage-migration.cap-CyyATY_p.js +330 -0
- package/system/dist/storage-migration.cap-D7QqGobp.mjs +313 -0
- package/system/dist/storage-occupancy.cap-2rmnS58Z.js +622 -0
- package/system/dist/storage-occupancy.cap-CqBztTl9.mjs +611 -0
- package/system/dist/storage-provider.cap-Bw0CfxVc.js +213 -0
- package/system/dist/storage-provider.cap-CMeck2w4.mjs +202 -0
- package/system/dist/stream-catalog.cap-Bp7SkgIf.mjs +6560 -0
- package/system/dist/stream-catalog.cap-D3uwePiA.js +6763 -0
- package/system/dist/streaming-shared-B8cXatuU.mjs +431 -0
- package/system/dist/streaming-shared-DQwFZOSi.js +526 -0
- package/system/dist/system-reasons-Be_k1W8g.js +25 -0
- package/system/dist/system-reasons-CYj4qwyS.mjs +20 -0
- package/system/dist/tag-BxLazvVb.js +2138 -0
- package/system/dist/tag-uZBAq6ox.mjs +2073 -0
- package/system/dist/user-management.cap-B9QDu8NE.js +825 -0
- package/system/dist/user-management.cap-DBIi77sB.mjs +766 -0
- package/system/dist/vector-store.cap-DnyfrYDn.js +330 -0
- package/system/dist/vector-store.cap-h2GHWQ1t.mjs +319 -0
- package/system/dist/{wal-maintenance-CTrCPzds.mjs → wal-maintenance-BG01rOn9.mjs} +0 -0
- package/system/dist/{wal-maintenance-dq7T3quB.js → wal-maintenance-DyrebYKF.js} +0 -0
- package/system/dist/zod-secret-DS7mj1bk.js +78 -0
- package/system/dist/zod-secret-zY4nM61M.mjs +73 -0
- package/system/package.json +1 -1
- package/system/dist/composition-sources-BI614LJx.mjs +0 -141
- package/system/dist/composition-sources-v_kkb8A9.js +0 -152
- package/system/dist/coral-accelerators-BSVsBVzt.js +0 -250
- package/system/dist/coral-accelerators-BW3OcrLD.mjs +0 -231
- package/system/dist/dist-BCHMSqzc.mjs +0 -143467
- package/system/dist/dist-BZfvhfS1.js +0 -146970
- package/system/dist/prefix-walk-DAOBSyH1.mjs +0 -88
- package/system/dist/prefix-walk-Dv6MLZlM.js +0 -99
- package/system/dist/rename-composition-block-C9HuBrKS.js +0 -112
- package/system/dist/rename-composition-block-DtaYmYAR.mjs +0 -101
package/system/dist/index.js
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
3
|
-
const
|
|
4
|
-
const
|
|
3
|
+
const require_base_addon = require("./base-addon-DD5dIfcZ.js");
|
|
4
|
+
const require_scoped_settings = require("./scoped-settings-CylSSq_8.js");
|
|
5
|
+
const require_rename_composition_block = require("./rename-composition-block-CcWLwVhG.js");
|
|
6
|
+
const require_camstack_error = require("./camstack-error-DJ-TUAi1.js");
|
|
7
|
+
const require_capability_definition = require("./capability-definition-HCmTem8c.js");
|
|
8
|
+
const require_record_kind = require("./record-kind-DoBfYHCs.js");
|
|
9
|
+
const require_wal_maintenance = require("./wal-maintenance-DyrebYKF.js");
|
|
10
|
+
const require_device_certificate = require("./device-certificate-CguVACQO.js");
|
|
11
|
+
const require_addon_settings_cap = require("./addon-settings.cap-DAiE0Nb0.js");
|
|
12
|
+
const require_prefix_walk = require("./prefix-walk-DC0ljmbB.js");
|
|
13
|
+
const require_network_access_cap = require("./network-access.cap-B5TWLDCC.js");
|
|
14
|
+
const require_constants = require("./constants-C860Y6U4.js");
|
|
15
|
+
const require_addon_id = require("./addon-id-Di0lNJ89.js");
|
|
16
|
+
const require_coral_accelerators = require("./coral-accelerators-7o8hqvcN.js");
|
|
17
|
+
const require_device_ca = require("./device-ca-C5kJE6mL.js");
|
|
5
18
|
const require_read_all_rows$1 = require("./read-all-rows-CVoO1ONM.js");
|
|
6
19
|
const require_log_redactor = require("./log-redactor-BhIEMaG9.js");
|
|
7
20
|
const require_builtins_alerts_alerts_addon = require("./builtins/alerts/alerts.addon.js");
|
|
@@ -12,7 +25,6 @@ const require_builtins_composer_composer_addon = require("./builtins/composer/co
|
|
|
12
25
|
require("./builtins/composer/index.js");
|
|
13
26
|
const require_formatter = require("./formatter-xbxeV4GD.js");
|
|
14
27
|
const require_builtins_console_logging_index = require("./builtins/console-logging/index.js");
|
|
15
|
-
const require_prefix_walk = require("./prefix-walk-Dv6MLZlM.js");
|
|
16
28
|
const require_cap_call_scope = require("./cap-call-scope-8eiugfLl.js");
|
|
17
29
|
const require_builtins_core_blocks_core_blocks_addon = require("./builtins/core-blocks/core-blocks.addon.js");
|
|
18
30
|
require("./builtins/core-blocks/index.js");
|
|
@@ -30,23 +42,21 @@ const require_builtins_loki_logging_index = require("./builtins/loki-logging/ind
|
|
|
30
42
|
const require_builtins_native_metrics_native_metrics_addon = require("./builtins/native-metrics/native-metrics.addon.js");
|
|
31
43
|
const require_builtins_device_history_device_history_addon = require("./builtins/device-history/device-history.addon.js");
|
|
32
44
|
const require_builtins_sqlite_storage_filesystem_storage_addon = require("./builtins/sqlite-storage/filesystem-storage.addon.js");
|
|
33
|
-
const
|
|
34
|
-
const require_legacy_integration_rows_door = require("./legacy-integration-rows-door-CVwOo5aq.js");
|
|
45
|
+
const require_legacy_integration_rows_door = require("./legacy-integration-rows-door-B1nzxxr5.js");
|
|
35
46
|
const require_builtins_sqlite_storage_sqlite_settings_addon = require("./builtins/sqlite-storage/sqlite-settings.addon.js");
|
|
36
47
|
const require_builtins_sqlite_storage_index = require("./builtins/sqlite-storage/index.js");
|
|
37
48
|
const require_builtins_storage_orchestrator_storage_orchestrator_addon = require("./builtins/storage-orchestrator/storage-orchestrator.addon.js");
|
|
38
49
|
require("./builtins/storage-orchestrator/index.js");
|
|
39
|
-
const require_hub_identity = require("./hub-identity-
|
|
40
|
-
const require_constants = require("./constants-
|
|
50
|
+
const require_hub_identity = require("./hub-identity-BMdR3Mw9.js");
|
|
51
|
+
const require_constants$1 = require("./constants-Ba3FTIHl.js");
|
|
41
52
|
const require_builtins_system_config_system_config_addon = require("./builtins/system-config/system-config.addon.js");
|
|
42
53
|
require("./builtins/system-config/index.js");
|
|
43
54
|
const require_builtins_winston_logging_index = require("./builtins/winston-logging/index.js");
|
|
44
55
|
const require_custom_action_registry = require("./custom-action-registry-CmWpSeMS.js");
|
|
45
|
-
const require_hub_mdns_ciao = require("./hub-mdns-ciao
|
|
56
|
+
const require_hub_mdns_ciao = require("./hub-mdns-ciao--0v1TKME.js");
|
|
46
57
|
const require_platform_key_source = require("./platform-key-source-Di7HrlGR.js");
|
|
47
58
|
const require_resource_monitor = require("./resource-monitor-mio9dSCT.js");
|
|
48
|
-
const require_restore_archive = require("./restore-archive-
|
|
49
|
-
const require_coral_accelerators = require("./coral-accelerators-BSVsBVzt.js");
|
|
59
|
+
const require_restore_archive = require("./restore-archive-CkTkv3Ss.js");
|
|
50
60
|
let zod = require("zod");
|
|
51
61
|
let node_crypto = require("node:crypto");
|
|
52
62
|
node_crypto = require_chunk.__toESM(node_crypto);
|
|
@@ -74,6 +84,608 @@ let node_vm = require("node:vm");
|
|
|
74
84
|
node_vm = require_chunk.__toESM(node_vm);
|
|
75
85
|
let _trpc_client = require("@trpc/client");
|
|
76
86
|
let _camstack_types_enums = require("@camstack/types/enums");
|
|
87
|
+
//#region ../types/dist/esm/addon/addon-instance.mjs
|
|
88
|
+
/**
|
|
89
|
+
* The integration instance of an addon, as it appears in an address or on an
|
|
90
|
+
* OAuth link (planning#415, D1046).
|
|
91
|
+
*
|
|
92
|
+
* The DEFAULT instance has two spellings on the wire and one in the code: a
|
|
93
|
+
* path with no instance segment and a link with no instance both mean it, and
|
|
94
|
+
* its id is the addon id. {@link oauthLinkServesInstance} is the one
|
|
95
|
+
* comparison a per-instance route is meant to call, so nobody compares
|
|
96
|
+
* `undefined` with an id. The Alexa export's routes are its first caller.
|
|
97
|
+
*/
|
|
98
|
+
/** An instance id as it may appear in a path or a query: no separator, no escape, bounded. */
|
|
99
|
+
var ADDON_INSTANCE_ID_RE = /^[A-Za-z0-9._-]{1,64}$/;
|
|
100
|
+
function isAddonInstanceId(value) {
|
|
101
|
+
return ADDON_INSTANCE_ID_RE.test(value);
|
|
102
|
+
}
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region ../types/dist/esm/interfaces/logging.mjs
|
|
105
|
+
/**
|
|
106
|
+
* Severity ordering. Declared once here because it had already been re-declared
|
|
107
|
+
* three times independently (`kernel/transport/uds-logger.ts`,
|
|
108
|
+
* `builtins/loki-logging/loki-destination.ts`, and the log buffer) — four copies
|
|
109
|
+
* of the same four numbers is four chances for one of them to disagree.
|
|
110
|
+
*
|
|
111
|
+
* `uds-logger` keeps its own copy on purpose: it ranks a plain `string` coming off
|
|
112
|
+
* the wire and needs a tolerant fallback for an unknown value, which this typed
|
|
113
|
+
* map deliberately does not offer.
|
|
114
|
+
*/
|
|
115
|
+
var LOG_LEVEL_RANK = {
|
|
116
|
+
debug: 0,
|
|
117
|
+
info: 1,
|
|
118
|
+
warn: 2,
|
|
119
|
+
error: 3
|
|
120
|
+
};
|
|
121
|
+
/** True when `level` is no more severe than `threshold` — i.e. prunable/filterable. */
|
|
122
|
+
function logLevelAtMost(level, threshold) {
|
|
123
|
+
return LOG_LEVEL_RANK[level] <= LOG_LEVEL_RANK[threshold];
|
|
124
|
+
}
|
|
125
|
+
//#endregion
|
|
126
|
+
//#region ../types/dist/esm/logging/debug-watch.mjs
|
|
127
|
+
/** Every debug channel's name starts with this; the ring denies it by default. */
|
|
128
|
+
var DEBUG_CHANNEL_PREFIX = "debug.";
|
|
129
|
+
function isDebugChannelName(name) {
|
|
130
|
+
return name.startsWith(DEBUG_CHANNEL_PREFIX);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Who is watching what, in THIS process. In-memory, moved off the log path.
|
|
134
|
+
*
|
|
135
|
+
* `active` is a plain boolean FIELD, read first: with no watch anywhere, a
|
|
136
|
+
* `ctx.debug` call is one load and one branch.
|
|
137
|
+
*/
|
|
138
|
+
var DebugInterest = class {
|
|
139
|
+
active = false;
|
|
140
|
+
windows = /* @__PURE__ */ new Map();
|
|
141
|
+
/**
|
|
142
|
+
* Replace the interest with the FULL set of windows. Non-debug windows are
|
|
143
|
+
* ignored and an absent one is dropped, so a lost disarm cannot leave a
|
|
144
|
+
* channel running.
|
|
145
|
+
*/
|
|
146
|
+
apply(windows, nowMs) {
|
|
147
|
+
this.windows.clear();
|
|
148
|
+
for (const window of windows) {
|
|
149
|
+
if (!isDebugChannelName(window.channel) || window.armedUntilMs <= nowMs) continue;
|
|
150
|
+
const ids = window.deviceIds;
|
|
151
|
+
this.windows.set(window.channel, {
|
|
152
|
+
untilMs: window.armedUntilMs,
|
|
153
|
+
devices: ids === null || ids.length === 0 ? null : new Set(ids)
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
this.active = this.windows.size > 0;
|
|
157
|
+
}
|
|
158
|
+
/** Drop what has lapsed. Called on a timer, never from a log path. */
|
|
159
|
+
tick(nowMs) {
|
|
160
|
+
const closed = [];
|
|
161
|
+
for (const [name, window] of this.windows) if (window.untilMs <= nowMs) {
|
|
162
|
+
this.windows.delete(name);
|
|
163
|
+
closed.push(name);
|
|
164
|
+
}
|
|
165
|
+
this.active = this.windows.size > 0;
|
|
166
|
+
return closed;
|
|
167
|
+
}
|
|
168
|
+
/** `channel` is the full name, `debug.<channel>`. */
|
|
169
|
+
wants(channel, deviceId) {
|
|
170
|
+
if (!this.active) return false;
|
|
171
|
+
const window = this.windows.get(channel);
|
|
172
|
+
if (window === void 0) return false;
|
|
173
|
+
return window.devices === null || window.devices.has(deviceId);
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
var interestInstance = null;
|
|
177
|
+
function getDebugInterest() {
|
|
178
|
+
interestInstance ??= new DebugInterest();
|
|
179
|
+
return interestInstance;
|
|
180
|
+
}
|
|
181
|
+
//#endregion
|
|
182
|
+
//#region ../types/dist/esm/readiness/readiness-registry.mjs
|
|
183
|
+
var ReadinessTimeoutError = class extends Error {
|
|
184
|
+
capName;
|
|
185
|
+
scope;
|
|
186
|
+
waitedMs;
|
|
187
|
+
constructor(capName, scope, waitedMs) {
|
|
188
|
+
super(`Timed out waiting for ${capName} (${scopeKey(scope)}) to become ready after ${waitedMs}ms`);
|
|
189
|
+
this.name = "ReadinessTimeoutError";
|
|
190
|
+
this.capName = capName;
|
|
191
|
+
this.scope = scope;
|
|
192
|
+
this.waitedMs = waitedMs;
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* Build a canonical string key for a `(capName, scope)` pair. Used as
|
|
197
|
+
* the snapshot map key and for log/debug output.
|
|
198
|
+
*/
|
|
199
|
+
function readinessKey(capName, scope) {
|
|
200
|
+
return `${capName}|${scopeKey(scope)}`;
|
|
201
|
+
}
|
|
202
|
+
function scopeKey(scope) {
|
|
203
|
+
switch (scope.type) {
|
|
204
|
+
case "global": return "global";
|
|
205
|
+
case "node": return `node:${scope.nodeId}`;
|
|
206
|
+
case "device": return `device:${scope.deviceId}`;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Producer transition order within ONE generation: `starting → ready →
|
|
211
|
+
* down`. Used by `hydrate` to accept only forward moves for
|
|
212
|
+
* same-generation snapshot records (a snapshot can be ahead of a lost
|
|
213
|
+
* delta, never behind it, within one producer generation).
|
|
214
|
+
*/
|
|
215
|
+
function stateRank(state) {
|
|
216
|
+
switch (state) {
|
|
217
|
+
case "starting": return 0;
|
|
218
|
+
case "ready": return 1;
|
|
219
|
+
case "down": return 2;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
function scopesEqual(a, b) {
|
|
223
|
+
if (a.type !== b.type) return false;
|
|
224
|
+
if (a.type === "global" || b.type === "global") return true;
|
|
225
|
+
if (a.type === "node" && b.type === "node") return a.nodeId === b.nodeId;
|
|
226
|
+
if (a.type === "device" && b.type === "device") return a.deviceId === b.deviceId;
|
|
227
|
+
return false;
|
|
228
|
+
}
|
|
229
|
+
var ReadinessRegistry = class {
|
|
230
|
+
bus;
|
|
231
|
+
sourceNodeId;
|
|
232
|
+
logger;
|
|
233
|
+
now;
|
|
234
|
+
generation;
|
|
235
|
+
verboseDeviceScopeLogs;
|
|
236
|
+
snapshot = /* @__PURE__ */ new Map();
|
|
237
|
+
subscriptions = /* @__PURE__ */ new Set();
|
|
238
|
+
unsubscribeBus;
|
|
239
|
+
unsubscribeAgentOffline;
|
|
240
|
+
constructor(options) {
|
|
241
|
+
this.bus = options.eventBus;
|
|
242
|
+
this.sourceNodeId = options.sourceNodeId;
|
|
243
|
+
this.logger = options.logger;
|
|
244
|
+
this.now = options.now ?? (() => Date.now());
|
|
245
|
+
this.generation = options.generation ?? randomGeneration();
|
|
246
|
+
this.verboseDeviceScopeLogs = options.verboseDeviceScopeLogs ?? false;
|
|
247
|
+
this.unsubscribeBus = this.bus.subscribe({ category: "system.ready-state" }, (event) => this.ingest(event.data));
|
|
248
|
+
this.unsubscribeAgentOffline = this.bus.subscribe({ category: "agent.offline" }, (event) => this.synthesizeDownForNode(event.data.agentId));
|
|
249
|
+
if (typeof this.bus.getRecent === "function") try {
|
|
250
|
+
const recent = this.bus.getRecent({ category: "system.ready-state" });
|
|
251
|
+
for (const event of recent) this.ingest(event.data);
|
|
252
|
+
} catch {}
|
|
253
|
+
}
|
|
254
|
+
/** Release the event-bus subscription. Idempotent. */
|
|
255
|
+
close() {
|
|
256
|
+
this.unsubscribeBus();
|
|
257
|
+
this.unsubscribeAgentOffline();
|
|
258
|
+
this.subscriptions.clear();
|
|
259
|
+
}
|
|
260
|
+
/** Current snapshot for a `(capName, scope)` pair, or `null` if never seen. */
|
|
261
|
+
get(capName, scope) {
|
|
262
|
+
return this.snapshot.get(readinessKey(capName, scope)) ?? null;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Serializable snapshot for cross-process transport. Returns an array
|
|
266
|
+
* of `ReadinessRecord` plain objects — safe for MsgPack / JSON
|
|
267
|
+
* transport. Used by the hub's `$readiness.getSnapshot` Moleculer
|
|
268
|
+
* action; consumers hydrate their local registry from the result.
|
|
269
|
+
*/
|
|
270
|
+
getSnapshotForTransport() {
|
|
271
|
+
return Array.from(this.snapshot.values());
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Hydrate the snapshot from an authoritative source — a RECONCILE, not
|
|
275
|
+
* an add-only merge (D8: readiness events are telemetry and may be
|
|
276
|
+
* lost; the on-reconnect/periodic snapshot re-pull is the repair path,
|
|
277
|
+
* so it MUST be able to advance a stale record — the 2026-07-17
|
|
278
|
+
* "still awaiting platform-probe forever" wedge was this method
|
|
279
|
+
* skipping every already-seen key).
|
|
280
|
+
*
|
|
281
|
+
* - **Unseen keys** are added (epoch 1 — mirrors the value the
|
|
282
|
+
* consumer would have derived from the first observed `ready`).
|
|
283
|
+
* - **Existing keys** are UPDATED when the authoritative record
|
|
284
|
+
* carries a different generation (producer restart / synthetic-down
|
|
285
|
+
* superseded — epoch bumps on a new-generation `ready`, mirroring
|
|
286
|
+
* `ingest`), or a FORWARD state move within the same generation
|
|
287
|
+
* (`starting → ready → down`; within one producer generation a
|
|
288
|
+
* snapshot can only be ahead of a lost delta, never behind it).
|
|
289
|
+
* - **Never a same-generation regress** — a snapshot pulled just
|
|
290
|
+
* before a live delta landed must not un-ready a record (the next
|
|
291
|
+
* reconcile round converges it anyway).
|
|
292
|
+
* - **Never a record this process is authoritative for** — node-scoped
|
|
293
|
+
* records for our own nodeId, and device/global records we emitted,
|
|
294
|
+
* keep local truth (an authority's stale copy of OUR record must
|
|
295
|
+
* not regress us).
|
|
296
|
+
*
|
|
297
|
+
* Every applied entry dispatches a one-shot transition to matching
|
|
298
|
+
* subscriptions so pending `awaitReady` callers unblock without having
|
|
299
|
+
* to wait for a fresh event.
|
|
300
|
+
*
|
|
301
|
+
* Returns the number of records APPLIED (added or advanced). Callers
|
|
302
|
+
* doing periodic reconciles use this to stay silent when the snapshot
|
|
303
|
+
* changed nothing — the every-60s "hydrated 1446 record(s)" heartbeat
|
|
304
|
+
* from every child process was pure noise (≈2 800 lines/hour observed
|
|
305
|
+
* live on 2026-08-01).
|
|
306
|
+
*/
|
|
307
|
+
hydrate(records) {
|
|
308
|
+
const now = this.now();
|
|
309
|
+
let applied = 0;
|
|
310
|
+
for (const record of records) {
|
|
311
|
+
const key = readinessKey(record.capName, record.scope);
|
|
312
|
+
const prev = this.snapshot.get(key) ?? null;
|
|
313
|
+
let epoch;
|
|
314
|
+
let durationInPrevState;
|
|
315
|
+
if (prev !== null) {
|
|
316
|
+
if (this.isLocallyAuthoritative(prev)) continue;
|
|
317
|
+
const sameGeneration = prev.generation === record.generation;
|
|
318
|
+
if (sameGeneration && stateRank(record.state) <= stateRank(prev.state)) continue;
|
|
319
|
+
epoch = !sameGeneration && record.state === "ready" ? prev.epoch + 1 : prev.epoch;
|
|
320
|
+
durationInPrevState = Math.max(0, now - prev.lastChange);
|
|
321
|
+
} else {
|
|
322
|
+
epoch = 1;
|
|
323
|
+
durationInPrevState = 0;
|
|
324
|
+
}
|
|
325
|
+
const hydrated = {
|
|
326
|
+
capName: record.capName,
|
|
327
|
+
scope: record.scope,
|
|
328
|
+
state: record.state,
|
|
329
|
+
generation: record.generation,
|
|
330
|
+
epoch,
|
|
331
|
+
lastChange: now,
|
|
332
|
+
sourceNodeId: record.sourceNodeId
|
|
333
|
+
};
|
|
334
|
+
this.snapshot.set(key, hydrated);
|
|
335
|
+
applied++;
|
|
336
|
+
this.logPerRecord(record.scope, `readiness: ${record.capName} (${scopeKey(record.scope)}) → ${record.state} (hydrated${prev !== null ? " update" : ""}, gen=${record.generation.slice(0, 6)})`);
|
|
337
|
+
const transition = {
|
|
338
|
+
capName: record.capName,
|
|
339
|
+
scope: record.scope,
|
|
340
|
+
state: record.state,
|
|
341
|
+
epoch,
|
|
342
|
+
generation: record.generation,
|
|
343
|
+
sourceNodeId: "hydrated",
|
|
344
|
+
ts: now,
|
|
345
|
+
durationInPrevState
|
|
346
|
+
};
|
|
347
|
+
for (const sub of this.subscriptions) {
|
|
348
|
+
if (sub.capName !== record.capName) continue;
|
|
349
|
+
if (!scopesEqual(sub.scope, record.scope)) continue;
|
|
350
|
+
try {
|
|
351
|
+
sub.handler(transition);
|
|
352
|
+
} catch (err) {
|
|
353
|
+
this.logger?.warn(`readiness hydrate handler threw for ${record.capName}: ${err.message ?? String(err)}`);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
return applied;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Per-record debug line, volume-gated: device-scoped records are logged
|
|
361
|
+
* only when `verboseDeviceScopeLogs` is set (see the option's doc for
|
|
362
|
+
* the 21 577-lines-per-boot-minute incident that forced the gate);
|
|
363
|
+
* node/global records always log. Device lines carry `tags.deviceId`
|
|
364
|
+
* so they group per-camera (CLAUDE.md logging rule).
|
|
365
|
+
*/
|
|
366
|
+
logPerRecord(scope, message) {
|
|
367
|
+
if (!this.logger) return;
|
|
368
|
+
if (scope.type === "device") {
|
|
369
|
+
if (!this.verboseDeviceScopeLogs) return;
|
|
370
|
+
this.logger.debug(message, { tags: { deviceId: scope.deviceId } });
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
this.logger.debug(message);
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* True when THIS process is the origin authority for `record` — a
|
|
377
|
+
* snapshot pulled from elsewhere must never overwrite it:
|
|
378
|
+
* - node-scoped records whose `scope.nodeId` is our own node id
|
|
379
|
+
* (this process — or a child bridged onto our bus — emits them);
|
|
380
|
+
* - device/global-scoped records whose latest transition WE emitted.
|
|
381
|
+
*/
|
|
382
|
+
isLocallyAuthoritative(record) {
|
|
383
|
+
if (record.scope.type === "node") return record.scope.nodeId === this.sourceNodeId;
|
|
384
|
+
return record.sourceNodeId === this.sourceNodeId;
|
|
385
|
+
}
|
|
386
|
+
/** Shallow copy of the full snapshot — mainly for diagnostics/tests. */
|
|
387
|
+
getAll() {
|
|
388
|
+
return new Map(this.snapshot);
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Emit a `ready` transition for a locally-owned capability. The
|
|
392
|
+
* payload carries this registry's `generation` so remote registries
|
|
393
|
+
* can derive their own `epoch`.
|
|
394
|
+
*/
|
|
395
|
+
emitReady(capName, scope) {
|
|
396
|
+
this.emitTransition(capName, scope, "ready");
|
|
397
|
+
}
|
|
398
|
+
emitStarting(capName, scope) {
|
|
399
|
+
this.emitTransition(capName, scope, "starting");
|
|
400
|
+
}
|
|
401
|
+
emitDown(capName, scope) {
|
|
402
|
+
this.emitTransition(capName, scope, "down");
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* One-shot: resolve once the cap is `ready`. Reads the snapshot
|
|
406
|
+
* first — if already ready, resolves synchronously on the next tick.
|
|
407
|
+
*
|
|
408
|
+
* Default behaviour is **wait indefinitely** (timeoutMs = `Infinity`):
|
|
409
|
+
* the orchestrator and other callers never want to attach a camera
|
|
410
|
+
* with empty steps just because a cap took longer than 30s to come
|
|
411
|
+
* up. Pass an explicit finite `timeoutMs` to bound the wait, or an
|
|
412
|
+
* `AbortSignal` to cancel externally. `Infinity` is honoured natively
|
|
413
|
+
* — no `setTimeout` is registered (Node's setTimeout silently clamps
|
|
414
|
+
* values above ~24.8d, so we must skip the timer entirely).
|
|
415
|
+
*/
|
|
416
|
+
awaitReady(capName, scope, opts = {}) {
|
|
417
|
+
const timeoutMs = opts.timeoutMs ?? Number.POSITIVE_INFINITY;
|
|
418
|
+
const start = this.now();
|
|
419
|
+
if (this.get(capName, scope)?.state === "ready") return Promise.resolve();
|
|
420
|
+
if (opts.signal?.aborted) return Promise.reject(opts.signal.reason ?? /* @__PURE__ */ new Error("aborted"));
|
|
421
|
+
return new Promise((resolve, reject) => {
|
|
422
|
+
let settled = false;
|
|
423
|
+
const unsubscribe = this.onReadyState(capName, scope, (t) => {
|
|
424
|
+
if (t.state !== "ready") return;
|
|
425
|
+
if (settled) return;
|
|
426
|
+
settled = true;
|
|
427
|
+
cleanup();
|
|
428
|
+
resolve();
|
|
429
|
+
});
|
|
430
|
+
const timer = !Number.isFinite(timeoutMs) ? null : setTimeout(() => {
|
|
431
|
+
if (settled) return;
|
|
432
|
+
settled = true;
|
|
433
|
+
cleanup();
|
|
434
|
+
reject(new ReadinessTimeoutError(capName, scope, this.now() - start));
|
|
435
|
+
}, timeoutMs);
|
|
436
|
+
const pendingLogTimer = setInterval(() => {
|
|
437
|
+
if (settled) return;
|
|
438
|
+
this.logger?.warn(`readiness: still awaiting ${capName} (${scopeKey(scope)}) after ${this.now() - start}ms`);
|
|
439
|
+
}, 3e4);
|
|
440
|
+
if (typeof pendingLogTimer.unref === "function") pendingLogTimer.unref();
|
|
441
|
+
const onAbort = () => {
|
|
442
|
+
if (settled) return;
|
|
443
|
+
settled = true;
|
|
444
|
+
cleanup();
|
|
445
|
+
reject(opts.signal?.reason ?? /* @__PURE__ */ new Error("aborted"));
|
|
446
|
+
};
|
|
447
|
+
opts.signal?.addEventListener("abort", onAbort, { once: true });
|
|
448
|
+
function cleanup() {
|
|
449
|
+
unsubscribe();
|
|
450
|
+
if (timer !== null) clearTimeout(timer);
|
|
451
|
+
clearInterval(pendingLogTimer);
|
|
452
|
+
opts.signal?.removeEventListener("abort", onAbort);
|
|
453
|
+
}
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* Observable: every transition (starting/ready/down) dispatches to
|
|
458
|
+
* `handler`. On subscription, if the snapshot has a current state,
|
|
459
|
+
* the handler fires ONCE asynchronously with that state as the
|
|
460
|
+
* initial transition (duration = 0) so late subscribers can pick up
|
|
461
|
+
* current state without racing the next transition.
|
|
462
|
+
*
|
|
463
|
+
* Returns an unsubscribe function.
|
|
464
|
+
*/
|
|
465
|
+
onReadyState(capName, scope, handler) {
|
|
466
|
+
const sub = {
|
|
467
|
+
capName,
|
|
468
|
+
scope,
|
|
469
|
+
handler
|
|
470
|
+
};
|
|
471
|
+
this.subscriptions.add(sub);
|
|
472
|
+
const current = this.get(capName, scope);
|
|
473
|
+
if (current !== null) queueMicrotask(() => {
|
|
474
|
+
if (!this.subscriptions.has(sub)) return;
|
|
475
|
+
handler({
|
|
476
|
+
capName,
|
|
477
|
+
scope,
|
|
478
|
+
state: current.state,
|
|
479
|
+
epoch: current.epoch,
|
|
480
|
+
generation: current.generation,
|
|
481
|
+
sourceNodeId: this.sourceNodeId,
|
|
482
|
+
ts: current.lastChange,
|
|
483
|
+
durationInPrevState: 0
|
|
484
|
+
});
|
|
485
|
+
});
|
|
486
|
+
return () => {
|
|
487
|
+
this.subscriptions.delete(sub);
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
emitTransition(capName, scope, state) {
|
|
491
|
+
const ts = this.now();
|
|
492
|
+
this.bus.emit(require_base_addon.createEvent("system.ready-state", {
|
|
493
|
+
type: "capability",
|
|
494
|
+
id: capName,
|
|
495
|
+
nodeId: this.sourceNodeId
|
|
496
|
+
}, {
|
|
497
|
+
capName,
|
|
498
|
+
scope,
|
|
499
|
+
state,
|
|
500
|
+
generation: this.generation,
|
|
501
|
+
sourceNodeId: this.sourceNodeId,
|
|
502
|
+
ts
|
|
503
|
+
}));
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Update snapshot + dispatch to subscribers. Idempotent: same
|
|
507
|
+
* `generation + state` replay is a no-op for both snapshot and
|
|
508
|
+
* subscribers.
|
|
509
|
+
*
|
|
510
|
+
* Defensive against malformed payloads (legal reason: a mock bus's
|
|
511
|
+
* `getRecent` may ignore the category filter and replay unrelated
|
|
512
|
+
* events when we hydrate at construction time).
|
|
513
|
+
*/
|
|
514
|
+
ingest(payload) {
|
|
515
|
+
if (typeof payload?.capName !== "string") return;
|
|
516
|
+
if (payload.state !== "ready" && payload.state !== "starting" && payload.state !== "down") return;
|
|
517
|
+
if (typeof payload.generation !== "string") return;
|
|
518
|
+
if (payload.scope?.type !== "global" && payload.scope?.type !== "node" && payload.scope?.type !== "device") return;
|
|
519
|
+
const key = readinessKey(payload.capName, payload.scope);
|
|
520
|
+
const prev = this.snapshot.get(key) ?? null;
|
|
521
|
+
const now = this.now();
|
|
522
|
+
let epoch;
|
|
523
|
+
if (prev === null) epoch = payload.state === "ready" ? 1 : 0;
|
|
524
|
+
else if (prev.generation !== payload.generation && payload.state === "ready") epoch = prev.epoch + 1;
|
|
525
|
+
else epoch = prev.epoch;
|
|
526
|
+
if (prev !== null && prev.generation === payload.generation && prev.state === payload.state) return;
|
|
527
|
+
const durationInPrevState = prev === null ? 0 : Math.max(0, now - prev.lastChange);
|
|
528
|
+
const next = {
|
|
529
|
+
capName: payload.capName,
|
|
530
|
+
scope: payload.scope,
|
|
531
|
+
state: payload.state,
|
|
532
|
+
generation: payload.generation,
|
|
533
|
+
epoch,
|
|
534
|
+
lastChange: now,
|
|
535
|
+
sourceNodeId: payload.sourceNodeId
|
|
536
|
+
};
|
|
537
|
+
this.snapshot.set(key, next);
|
|
538
|
+
const transition = {
|
|
539
|
+
capName: payload.capName,
|
|
540
|
+
scope: payload.scope,
|
|
541
|
+
state: payload.state,
|
|
542
|
+
epoch,
|
|
543
|
+
generation: payload.generation,
|
|
544
|
+
sourceNodeId: payload.sourceNodeId,
|
|
545
|
+
ts: payload.ts,
|
|
546
|
+
durationInPrevState
|
|
547
|
+
};
|
|
548
|
+
this.logPerRecord(payload.scope, `readiness: ${payload.capName} (${scopeKey(payload.scope)}) → ${payload.state} epoch=${epoch} gen=${payload.generation.slice(0, 6)} (prev ${durationInPrevState}ms)`);
|
|
549
|
+
for (const sub of this.subscriptions) {
|
|
550
|
+
if (sub.capName !== payload.capName) continue;
|
|
551
|
+
if (!scopesEqual(sub.scope, payload.scope)) continue;
|
|
552
|
+
try {
|
|
553
|
+
sub.handler(transition);
|
|
554
|
+
} catch (err) {
|
|
555
|
+
this.logger?.warn(`readiness handler threw for ${payload.capName}: ${err.message ?? String(err)}`);
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
/**
|
|
560
|
+
* `agent.offline` demux. When an agent disconnects ungracefully,
|
|
561
|
+
* its BaseAddon's shutdown hook doesn't fire — consumers would
|
|
562
|
+
* otherwise keep waiting on a stale `ready`. Walk the snapshot and
|
|
563
|
+
* synthesize a `down` transition for every node-scoped record bound
|
|
564
|
+
* to the disconnected `nodeId`, skipping records already `down`.
|
|
565
|
+
*
|
|
566
|
+
* Synthesis is LOCAL: we don't re-emit on the bus. Every registry
|
|
567
|
+
* (one per process) receives the same `agent.offline` and reacts
|
|
568
|
+
* independently, which means no duplicated downs and no central
|
|
569
|
+
* supervisor required.
|
|
570
|
+
*/
|
|
571
|
+
synthesizeDownForNode(offlineNodeId) {
|
|
572
|
+
const now = this.now();
|
|
573
|
+
for (const [key, record] of this.snapshot) {
|
|
574
|
+
if (record.state === "down") continue;
|
|
575
|
+
if (!(record.scope.type === "node" && record.scope.nodeId === offlineNodeId || record.scope.type === "device" && record.sourceNodeId === offlineNodeId)) continue;
|
|
576
|
+
const durationInPrevState = Math.max(0, now - record.lastChange);
|
|
577
|
+
const next = {
|
|
578
|
+
...record,
|
|
579
|
+
state: "down",
|
|
580
|
+
lastChange: now
|
|
581
|
+
};
|
|
582
|
+
this.snapshot.set(key, next);
|
|
583
|
+
const transition = {
|
|
584
|
+
capName: record.capName,
|
|
585
|
+
scope: record.scope,
|
|
586
|
+
state: "down",
|
|
587
|
+
epoch: record.epoch,
|
|
588
|
+
generation: record.generation,
|
|
589
|
+
sourceNodeId: this.sourceNodeId,
|
|
590
|
+
ts: now,
|
|
591
|
+
durationInPrevState
|
|
592
|
+
};
|
|
593
|
+
this.logPerRecord(record.scope, `readiness: ${record.capName} (${scopeKey(record.scope)}) → down (synthesized from agent.offline ${offlineNodeId})`);
|
|
594
|
+
for (const sub of this.subscriptions) {
|
|
595
|
+
if (sub.capName !== record.capName) continue;
|
|
596
|
+
if (!scopesEqual(sub.scope, record.scope)) continue;
|
|
597
|
+
try {
|
|
598
|
+
sub.handler(transition);
|
|
599
|
+
} catch (err) {
|
|
600
|
+
this.logger?.warn(`readiness handler threw during agent.offline demux for ${record.capName}: ${err.message ?? String(err)}`);
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
};
|
|
606
|
+
function randomGeneration() {
|
|
607
|
+
if (typeof crypto !== "undefined" && crypto.randomUUID) return crypto.randomUUID();
|
|
608
|
+
return Math.random().toString(36).slice(2, 14);
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
* Given a list of `(capName, scope)` pairs that a just-disconnected
|
|
612
|
+
* node owned, emit a `down` transition for each. Callers (kernel
|
|
613
|
+
* supervisor, hub `$node.disconnected` handler) wire this up once they
|
|
614
|
+
* know which caps the node held.
|
|
615
|
+
*/
|
|
616
|
+
function emitDownForOwnedCaps(registry, owned) {
|
|
617
|
+
for (const { capName, scope } of owned) registry.emitDown(capName, scope);
|
|
618
|
+
}
|
|
619
|
+
//#endregion
|
|
620
|
+
//#region ../types/dist/esm/auth/principal-scope.mjs
|
|
621
|
+
/**
|
|
622
|
+
* True if the scope set grants `access` on device-scoped capabilities.
|
|
623
|
+
* A `category:device` grant covers every device cap (the broad grant).
|
|
624
|
+
*/
|
|
625
|
+
function scopesAllowDeviceCap(scopes, access) {
|
|
626
|
+
return scopes.some((s) => s.type === "category" && s.target === "device" && s.access.includes(access));
|
|
627
|
+
}
|
|
628
|
+
/**
|
|
629
|
+
* True if the scope set names this addon with at least `access`.
|
|
630
|
+
*
|
|
631
|
+
* Deliberately NOT satisfied by `category:device`: a grant over per-camera
|
|
632
|
+
* capabilities says nothing about an addon's own HTTP surface, and conflating
|
|
633
|
+
* the two is precisely the confusion that let an Alexa token drive Home
|
|
634
|
+
* Assistant's command route.
|
|
635
|
+
*/
|
|
636
|
+
function scopesAllowAddon(scopes, addonId, access) {
|
|
637
|
+
return scopes.some((s) => s.type === "addon" && s.target === addonId && s.access.includes(access));
|
|
638
|
+
}
|
|
639
|
+
//#endregion
|
|
640
|
+
//#region ../types/dist/esm/capabilities/caller-stamp.mjs
|
|
641
|
+
/**
|
|
642
|
+
* Every cap whose provider reads a `callerAddonId` in its input (the keychain's
|
|
643
|
+
* owner check, device-history's `not-owner`, records' owner).
|
|
644
|
+
*
|
|
645
|
+
* The stamp is set ONLY by the transport (`stampCallerAddonId`, or stated by a
|
|
646
|
+
* hub in-process caller). HTTP/WS mounts parse input with `.loose()`, so a
|
|
647
|
+
* session could add the key itself and act as another addon — those procedures
|
|
648
|
+
* strip it when `ctx.req` is present. Mesh / `$core-caps` calls have no request;
|
|
649
|
+
* the transport stamp must survive to the provider.
|
|
650
|
+
*/
|
|
651
|
+
var CALLER_STAMPED_CAPABILITIES$2 = [
|
|
652
|
+
"keychain",
|
|
653
|
+
"device-history",
|
|
654
|
+
"records",
|
|
655
|
+
"integrations",
|
|
656
|
+
"device-manager",
|
|
657
|
+
"core-blocks",
|
|
658
|
+
"migrations",
|
|
659
|
+
"device-transitions",
|
|
660
|
+
"integration-instances"
|
|
661
|
+
];
|
|
662
|
+
/** A copy of `input` without the caller stamp. Anything that is not a plain object passes through. */
|
|
663
|
+
function withoutCallerStamp(input) {
|
|
664
|
+
if (input === null || typeof input !== "object" || Array.isArray(input)) return input;
|
|
665
|
+
if (!Object.prototype.hasOwnProperty.call(input, "callerAddonId")) return input;
|
|
666
|
+
return Object.fromEntries(Object.entries(input).filter(([key]) => key !== "callerAddonId"));
|
|
667
|
+
}
|
|
668
|
+
var CATALOG_LANGS = require_device_certificate.AppPageLangSchema.options;
|
|
669
|
+
/** One catalog file: flat key to text. A file of any other shape is rejected whole. */
|
|
670
|
+
var CatalogFileSchema = /* @__PURE__ */ zod.z.record(/* @__PURE__ */ zod.z.string().min(1), /* @__PURE__ */ zod.z.string());
|
|
671
|
+
/** Fills `{name}` placeholders; an unknown placeholder is left as written. */
|
|
672
|
+
function interpolate(template, params) {
|
|
673
|
+
if (params === void 0) return template;
|
|
674
|
+
return template.replace(/\{(\w+)\}/g, (whole, name) => {
|
|
675
|
+
const value = params[name];
|
|
676
|
+
return value === void 0 ? whole : String(value);
|
|
677
|
+
});
|
|
678
|
+
}
|
|
679
|
+
/** Splits `"ns:key"`; `null` when the reference has no namespace. */
|
|
680
|
+
function splitTranslationRef(ref) {
|
|
681
|
+
const at = ref.indexOf(":");
|
|
682
|
+
if (at <= 0 || at === ref.length - 1) return null;
|
|
683
|
+
return {
|
|
684
|
+
ns: ref.slice(0, at),
|
|
685
|
+
key: ref.slice(at + 1)
|
|
686
|
+
};
|
|
687
|
+
}
|
|
688
|
+
//#endregion
|
|
77
689
|
//#region src/addon/addon-api-factory.ts
|
|
78
690
|
/**
|
|
79
691
|
* Wrap a raw tRPC caller (from `createCallerFactory`) in a proxy that
|
|
@@ -143,7 +755,7 @@ function resolveAddonInstancePath(addonId, path) {
|
|
|
143
755
|
routePath: path
|
|
144
756
|
};
|
|
145
757
|
const instanceId = parts[4];
|
|
146
|
-
if (instanceId === void 0 || !
|
|
758
|
+
if (instanceId === void 0 || !isAddonInstanceId(instanceId)) return null;
|
|
147
759
|
return {
|
|
148
760
|
instanceId,
|
|
149
761
|
routePath: [
|
|
@@ -509,7 +1121,7 @@ function proxyToUpstream(opts) {
|
|
|
509
1121
|
delete headers.connection;
|
|
510
1122
|
delete headers["content-length"];
|
|
511
1123
|
if (replayBody !== void 0) headers["content-length"] = replayBody.byteLength;
|
|
512
|
-
headers[
|
|
1124
|
+
headers[require_builtins_local_auth_local_auth_addon.DATAPLANE_SECRET_HEADER] = secret;
|
|
513
1125
|
const upstream = (0, node_http.request)({
|
|
514
1126
|
protocol: base.protocol,
|
|
515
1127
|
hostname: base.hostname,
|
|
@@ -3971,9 +4583,9 @@ function matchesLogTags(entryTags, filterTags) {
|
|
|
3971
4583
|
*/
|
|
3972
4584
|
function admitsDebugLine(entry) {
|
|
3973
4585
|
const channel = entry.tags?.logChannel;
|
|
3974
|
-
if (channel === void 0 || !
|
|
4586
|
+
if (channel === void 0 || !isDebugChannelName(channel)) return true;
|
|
3975
4587
|
const deviceId = entry.tags?.deviceId;
|
|
3976
|
-
return typeof deviceId === "number" &&
|
|
4588
|
+
return typeof deviceId === "number" && getDebugInterest().wants(channel, deviceId);
|
|
3977
4589
|
}
|
|
3978
4590
|
var LogRingBuffer = class {
|
|
3979
4591
|
capacity;
|
|
@@ -4064,7 +4676,7 @@ var LogRingBuffer = class {
|
|
|
4064
4676
|
for (let i = this.count - 1; i >= 0 && victims.size < max; i--) {
|
|
4065
4677
|
const index = (this.head - 1 - i + this.capacity) % this.capacity;
|
|
4066
4678
|
const entry = this.buffer[index];
|
|
4067
|
-
if (entry !== void 0 &&
|
|
4679
|
+
if (entry !== void 0 && logLevelAtMost(entry.level, threshold)) victims.add(index);
|
|
4068
4680
|
}
|
|
4069
4681
|
if (victims.size === 0) return 0;
|
|
4070
4682
|
const survivors = [];
|
|
@@ -4131,7 +4743,7 @@ var DEFAULT_LOG_LEVEL = "debug";
|
|
|
4131
4743
|
var LoggingGate = class {
|
|
4132
4744
|
/** The ONLY field an unrestricted log path reads. */
|
|
4133
4745
|
restricted = false;
|
|
4134
|
-
floorRank =
|
|
4746
|
+
floorRank = LOG_LEVEL_RANK[DEFAULT_LOG_LEVEL];
|
|
4135
4747
|
floor = DEFAULT_LOG_LEVEL;
|
|
4136
4748
|
/** The effective node-wide level currently mirrored. */
|
|
4137
4749
|
get destinationFloor() {
|
|
@@ -4148,7 +4760,7 @@ var LoggingGate = class {
|
|
|
4148
4760
|
*/
|
|
4149
4761
|
allowsDestination(entry) {
|
|
4150
4762
|
if (!this.restricted) return true;
|
|
4151
|
-
return
|
|
4763
|
+
return LOG_LEVEL_RANK[entry.level] >= this.floorRank;
|
|
4152
4764
|
}
|
|
4153
4765
|
/**
|
|
4154
4766
|
* Refresh the mirror. Called off the hot path — on an operator write and
|
|
@@ -4156,8 +4768,8 @@ var LoggingGate = class {
|
|
|
4156
4768
|
*/
|
|
4157
4769
|
setDestinationFloor(level) {
|
|
4158
4770
|
this.floor = level;
|
|
4159
|
-
this.floorRank =
|
|
4160
|
-
this.restricted = this.floorRank >
|
|
4771
|
+
this.floorRank = LOG_LEVEL_RANK[level];
|
|
4772
|
+
this.restricted = this.floorRank > LOG_LEVEL_RANK[DEFAULT_LOG_LEVEL];
|
|
4161
4773
|
}
|
|
4162
4774
|
};
|
|
4163
4775
|
//#endregion
|
|
@@ -4868,7 +5480,7 @@ var NotificationService = class {
|
|
|
4868
5480
|
this.logger.error("Notification target failed", { meta: {
|
|
4869
5481
|
addonId: ref.addonId,
|
|
4870
5482
|
targetId: ref.targetId,
|
|
4871
|
-
error:
|
|
5483
|
+
error: require_scoped_settings.errMsg(err)
|
|
4872
5484
|
} });
|
|
4873
5485
|
}
|
|
4874
5486
|
}));
|
|
@@ -4993,7 +5605,7 @@ var PipelineRunner = class {
|
|
|
4993
5605
|
}
|
|
4994
5606
|
} catch (error) {
|
|
4995
5607
|
const stepMs = performance.now() - stepStart;
|
|
4996
|
-
const message =
|
|
5608
|
+
const message = require_scoped_settings.errMsg(error);
|
|
4997
5609
|
results.push({
|
|
4998
5610
|
addon: node.addon,
|
|
4999
5611
|
slot: "detector",
|
|
@@ -5090,7 +5702,7 @@ var PythonEnvManager = class {
|
|
|
5090
5702
|
}
|
|
5091
5703
|
async ensure(options) {
|
|
5092
5704
|
const probe = await this.probe();
|
|
5093
|
-
if (!probe.available || !probe.path) throw
|
|
5705
|
+
if (!probe.available || !probe.path) throw require_camstack_error.userError("system.python-required", void 0, "Python 3.10+ is required but not found on this system");
|
|
5094
5706
|
if (!node_fs.existsSync(node_path.join(this.venvPath, "bin", "python"))) await execFileAsync$7(probe.path, [
|
|
5095
5707
|
"-m",
|
|
5096
5708
|
"venv",
|
|
@@ -5358,7 +5970,7 @@ var StorageManager = class {
|
|
|
5358
5970
|
}
|
|
5359
5971
|
getProvider() {
|
|
5360
5972
|
if (this.legacyProvider) return this.legacyProvider;
|
|
5361
|
-
if (!this.newStorageProvider && !this.settingsBackend && !this.locationManager) throw
|
|
5973
|
+
if (!this.newStorageProvider && !this.settingsBackend && !this.locationManager) throw require_camstack_error.userError("storage.no-provider", void 0, "No storage provider configured");
|
|
5362
5974
|
return this.createLegacyShim();
|
|
5363
5975
|
}
|
|
5364
5976
|
setLocationManager(manager) {
|
|
@@ -5381,7 +5993,7 @@ var StorageManager = class {
|
|
|
5381
5993
|
* Builds IStorageLocation from settingsBackend (structured) + locationManager (files).
|
|
5382
5994
|
*/
|
|
5383
5995
|
getLocation(name, namespace) {
|
|
5384
|
-
if (!this.legacyProvider && !this.newStorageProvider && !this.settingsBackend && !this.locationManager) throw
|
|
5996
|
+
if (!this.legacyProvider && !this.newStorageProvider && !this.settingsBackend && !this.locationManager) throw require_camstack_error.userError("storage.no-provider", void 0, "No storage provider configured");
|
|
5385
5997
|
if (this.legacyProvider) try {
|
|
5386
5998
|
const LEGACY_MAP = {
|
|
5387
5999
|
config: "data",
|
|
@@ -5565,15 +6177,15 @@ var StorageManager = class {
|
|
|
5565
6177
|
//#region src/builtins/local-network/agent-mdns.ts
|
|
5566
6178
|
function buildAgentAnnouncement(inputs) {
|
|
5567
6179
|
const txt = {
|
|
5568
|
-
[
|
|
5569
|
-
[
|
|
6180
|
+
[require_network_access_cap.AGENT_MDNS_TXT_KEYS.nodeId]: inputs.nodeId,
|
|
6181
|
+
[require_network_access_cap.AGENT_MDNS_TXT_KEYS.state]: inputs.state
|
|
5570
6182
|
};
|
|
5571
|
-
if (inputs.version !== null) txt[
|
|
5572
|
-
if (inputs.name !== void 0 && inputs.name !== null && inputs.name.length > 0) txt[
|
|
5573
|
-
if (inputs.leafFingerprint !== null) txt[
|
|
6183
|
+
if (inputs.version !== null) txt[require_network_access_cap.AGENT_MDNS_TXT_KEYS.version] = inputs.version;
|
|
6184
|
+
if (inputs.name !== void 0 && inputs.name !== null && inputs.name.length > 0) txt[require_network_access_cap.AGENT_MDNS_TXT_KEYS.name] = inputs.name;
|
|
6185
|
+
if (inputs.leafFingerprint !== null) txt[require_network_access_cap.AGENT_MDNS_TXT_KEYS.keyFingerprint] = inputs.leafFingerprint;
|
|
5574
6186
|
return {
|
|
5575
6187
|
name: `camstack-agent-${inputs.nodeId}`,
|
|
5576
|
-
type:
|
|
6188
|
+
type: require_network_access_cap.AGENT_MDNS_SERVICE_TYPE,
|
|
5577
6189
|
port: inputs.port,
|
|
5578
6190
|
address: null,
|
|
5579
6191
|
txt
|
|
@@ -5656,7 +6268,7 @@ var IntegrationBodySchema = zod.z.object({
|
|
|
5656
6268
|
createdAt: zod.z.number(),
|
|
5657
6269
|
updatedAt: zod.z.number()
|
|
5658
6270
|
});
|
|
5659
|
-
var _integrationRegistryRecordKinds =
|
|
6271
|
+
var _integrationRegistryRecordKinds = require_record_kind.defineRecordKinds({ integrations: {
|
|
5660
6272
|
schema: IntegrationBodySchema,
|
|
5661
6273
|
class: "config",
|
|
5662
6274
|
writeTrigger: "createIntegration / updateIntegration / deleteIntegration",
|
|
@@ -5684,7 +6296,7 @@ function isPlainObject(value) {
|
|
|
5684
6296
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
5685
6297
|
}
|
|
5686
6298
|
function readInfo(raw) {
|
|
5687
|
-
if (typeof raw === "string") return
|
|
6299
|
+
if (typeof raw === "string") return require_wal_maintenance.parseJsonObject(raw) ?? {};
|
|
5688
6300
|
if (isPlainObject(raw)) return { ...raw };
|
|
5689
6301
|
return {};
|
|
5690
6302
|
}
|
|
@@ -5742,7 +6354,7 @@ var IntegrationRegistry = class IntegrationRegistry {
|
|
|
5742
6354
|
async createIntegration(rawInput) {
|
|
5743
6355
|
const input = {
|
|
5744
6356
|
...rawInput,
|
|
5745
|
-
addonId:
|
|
6357
|
+
addonId: require_addon_id.bareAddonId(rawInput.addonId)
|
|
5746
6358
|
};
|
|
5747
6359
|
const id = input.id ?? nextIntegrationId();
|
|
5748
6360
|
const now = Math.floor(Date.now() / 1e3);
|
|
@@ -5768,7 +6380,7 @@ var IntegrationRegistry = class IntegrationRegistry {
|
|
|
5768
6380
|
return row === null ? null : mapIntegrationBody(row.id, row.data);
|
|
5769
6381
|
}
|
|
5770
6382
|
async getIntegrationByAddonId(rawAddonId) {
|
|
5771
|
-
const addonId =
|
|
6383
|
+
const addonId = require_addon_id.bareAddonId(rawAddonId);
|
|
5772
6384
|
const row = (await this.recordStores.integrations.query({
|
|
5773
6385
|
where: { addonId },
|
|
5774
6386
|
limit: 1
|
|
@@ -5827,7 +6439,7 @@ var IntegrationRegistry = class IntegrationRegistry {
|
|
|
5827
6439
|
* so a failed delete leaves the rows to retry). A missing store is a no-op. Counts only.
|
|
5828
6440
|
*/
|
|
5829
6441
|
async function clearIntegrationRows(db, secrets, integrationId) {
|
|
5830
|
-
const refs =
|
|
6442
|
+
const refs = require_base_addon.collectSecretMarkerRefs(require_legacy_integration_rows_door.readLegacyIntegrationRows(db, integrationId));
|
|
5831
6443
|
if (refs.length > 0 && secrets !== null) await secrets.delete(refs);
|
|
5832
6444
|
return require_legacy_integration_rows_door.clearLegacyIntegrationRows(db, integrationId);
|
|
5833
6445
|
}
|
|
@@ -5873,7 +6485,7 @@ var ClusterNodeTombstoneBodySchema = zod.z.object({
|
|
|
5873
6485
|
removedAt: zod.z.number(),
|
|
5874
6486
|
pending: zod.z.array(zod.z.string()).readonly()
|
|
5875
6487
|
});
|
|
5876
|
-
var _clusterAgentRecordKinds =
|
|
6488
|
+
var _clusterAgentRecordKinds = require_record_kind.defineRecordKinds({
|
|
5877
6489
|
"node-history": clusterNodeHistoryKindSpec,
|
|
5878
6490
|
"node-tombstones": {
|
|
5879
6491
|
schema: ClusterNodeTombstoneBodySchema,
|
|
@@ -6369,7 +6981,7 @@ function readOwningPackageVersion(entryPath) {
|
|
|
6369
6981
|
let dir = node_path.dirname(entryPath);
|
|
6370
6982
|
for (let hop = 0; hop < PACKAGE_JSON_LOOKUP_DEPTH; hop++) {
|
|
6371
6983
|
try {
|
|
6372
|
-
const version =
|
|
6984
|
+
const version = require_wal_maintenance.asJsonObject(require_wal_maintenance.parseJsonUnknown(node_fs.readFileSync(node_path.join(dir, "package.json"), "utf-8")))?.["version"];
|
|
6373
6985
|
if (typeof version === "string" && version.length > 0) return version;
|
|
6374
6986
|
} catch {}
|
|
6375
6987
|
const parent = node_path.dirname(dir);
|
|
@@ -6563,7 +7175,7 @@ var AddonLoader = class {
|
|
|
6563
7175
|
/** Load addon from a specific directory (package.json + dist/) */
|
|
6564
7176
|
async loadFromAddonDir(addonDir) {
|
|
6565
7177
|
const pkgJsonPath = node_path.join(addonDir, "package.json");
|
|
6566
|
-
const pkgJson =
|
|
7178
|
+
const pkgJson = require_wal_maintenance.asJsonObject(require_wal_maintenance.parseJsonUnknown(node_fs.readFileSync(pkgJsonPath, "utf-8"))) ?? {};
|
|
6567
7179
|
const packageNameRaw = pkgJson["name"];
|
|
6568
7180
|
const packageName = typeof packageNameRaw === "string" ? packageNameRaw : "";
|
|
6569
7181
|
const packageVersionRaw = pkgJson["version"];
|
|
@@ -7024,7 +7636,7 @@ async function installPackageFromNpm(packageName, targetDir) {
|
|
|
7024
7636
|
const distSrc = node_path.join(srcPkgJsonDir, "dist");
|
|
7025
7637
|
if (node_fs.existsSync(distSrc)) await copyDirRecursive(distSrc, node_path.join(targetDir, "dist"));
|
|
7026
7638
|
try {
|
|
7027
|
-
const npmPkg =
|
|
7639
|
+
const npmPkg = require_wal_maintenance.asJsonObject(require_wal_maintenance.parseJsonUnknown(await node_fs.promises.readFile(node_path.join(srcPkgJsonDir, "package.json"), "utf-8")));
|
|
7028
7640
|
if (npmPkg) await copyExtraFileDirs(npmPkg, srcPkgJsonDir, targetDir);
|
|
7029
7641
|
} catch {}
|
|
7030
7642
|
} finally {
|
|
@@ -7489,7 +8101,7 @@ function planClosureDedupe(input) {
|
|
|
7489
8101
|
function readTreeManifest(pkgJsonPath) {
|
|
7490
8102
|
let raw;
|
|
7491
8103
|
try {
|
|
7492
|
-
raw =
|
|
8104
|
+
raw = require_wal_maintenance.asJsonObject(require_wal_maintenance.parseJsonUnknown(node_fs.readFileSync(pkgJsonPath, "utf-8")));
|
|
7493
8105
|
} catch {
|
|
7494
8106
|
return null;
|
|
7495
8107
|
}
|
|
@@ -7500,11 +8112,11 @@ function readTreeManifest(pkgJsonPath) {
|
|
|
7500
8112
|
"optionalDependencies",
|
|
7501
8113
|
"peerDependencies"
|
|
7502
8114
|
]) {
|
|
7503
|
-
const deps =
|
|
8115
|
+
const deps = require_wal_maintenance.asJsonObject(raw[key]);
|
|
7504
8116
|
if (deps === null) continue;
|
|
7505
8117
|
for (const [name, range] of Object.entries(deps)) if (typeof range === "string" && !ranges.has(name)) ranges.set(name, range);
|
|
7506
8118
|
}
|
|
7507
|
-
const version =
|
|
8119
|
+
const version = require_wal_maintenance.asString(raw["version"]);
|
|
7508
8120
|
return {
|
|
7509
8121
|
version: version.length > 0 ? version : null,
|
|
7510
8122
|
ranges
|
|
@@ -7634,7 +8246,7 @@ function executeClosureDedupe(addonDir, closureNodeModulesDir, plan, logger) {
|
|
|
7634
8246
|
} catch (err) {
|
|
7635
8247
|
logger.warn("closure dedupe skipped — symlinks unavailable on this volume", { meta: {
|
|
7636
8248
|
addonDir,
|
|
7637
|
-
error:
|
|
8249
|
+
error: require_scoped_settings.errMsg(err)
|
|
7638
8250
|
} });
|
|
7639
8251
|
return [];
|
|
7640
8252
|
}
|
|
@@ -7662,7 +8274,7 @@ function executeClosureDedupe(addonDir, closureNodeModulesDir, plan, logger) {
|
|
|
7662
8274
|
} catch (err) {
|
|
7663
8275
|
logger.warn("closure dedupe — link failed; entry removed copy may need reinstall", { meta: {
|
|
7664
8276
|
name: link.name,
|
|
7665
|
-
error:
|
|
8277
|
+
error: require_scoped_settings.errMsg(err)
|
|
7666
8278
|
} });
|
|
7667
8279
|
}
|
|
7668
8280
|
}
|
|
@@ -8068,7 +8680,7 @@ function isStable(version) {
|
|
|
8068
8680
|
}
|
|
8069
8681
|
function parseRequires(value) {
|
|
8070
8682
|
if (value === void 0 || value === null) return void 0;
|
|
8071
|
-
const parsed =
|
|
8683
|
+
const parsed = require_rename_composition_block.PackageRequiresSchema.safeParse(value);
|
|
8072
8684
|
if (!parsed.success) throw new RegistryReadError("unavailable", "the registry document carries a malformed requires");
|
|
8073
8685
|
return parsed.data;
|
|
8074
8686
|
}
|
|
@@ -8129,7 +8741,7 @@ function createRequiresRegistry(deps) {
|
|
|
8129
8741
|
]);
|
|
8130
8742
|
names = Array.isArray(listed) ? listed.filter((v) => typeof v === "string") : typeof listed === "string" ? [listed] : [];
|
|
8131
8743
|
}
|
|
8132
|
-
return names.filter(isStable).sort((a, b) =>
|
|
8744
|
+
return names.filter(isStable).sort((a, b) => require_rename_composition_block.compareVersions(b, a));
|
|
8133
8745
|
}
|
|
8134
8746
|
};
|
|
8135
8747
|
}
|
|
@@ -8143,9 +8755,9 @@ var execFileAsync$2 = (0, node_util.promisify)(node_child_process.execFile);
|
|
|
8143
8755
|
*/
|
|
8144
8756
|
function readNativeDependencyNames(pkg) {
|
|
8145
8757
|
if (pkg === void 0) return /* @__PURE__ */ new Set();
|
|
8146
|
-
const camstack =
|
|
8758
|
+
const camstack = require_wal_maintenance.asJsonObject(pkg["camstack"]);
|
|
8147
8759
|
if (camstack === null) return /* @__PURE__ */ new Set();
|
|
8148
|
-
const native =
|
|
8760
|
+
const native = require_wal_maintenance.asJsonObject(camstack["nativeDependencies"]);
|
|
8149
8761
|
return native === null ? /* @__PURE__ */ new Set() : new Set(Object.keys(native));
|
|
8150
8762
|
}
|
|
8151
8763
|
function parseInstallSource(value) {
|
|
@@ -8160,15 +8772,15 @@ function parseInstallSource(value) {
|
|
|
8160
8772
|
function readPackageJson(pkgJsonPath) {
|
|
8161
8773
|
let raw;
|
|
8162
8774
|
try {
|
|
8163
|
-
raw =
|
|
8775
|
+
raw = require_wal_maintenance.asJsonObject(require_wal_maintenance.parseJsonUnknown(node_fs.readFileSync(pkgJsonPath, "utf-8")));
|
|
8164
8776
|
} catch {
|
|
8165
8777
|
return null;
|
|
8166
8778
|
}
|
|
8167
8779
|
if (!raw) return null;
|
|
8168
|
-
const name =
|
|
8169
|
-
const version =
|
|
8780
|
+
const name = require_wal_maintenance.asString(raw["name"]);
|
|
8781
|
+
const version = require_wal_maintenance.asString(raw["version"]);
|
|
8170
8782
|
if (!name || !version) return null;
|
|
8171
|
-
const camstack =
|
|
8783
|
+
const camstack = require_wal_maintenance.asJsonObject(raw["camstack"]);
|
|
8172
8784
|
const addonsField = camstack ? camstack["addons"] : void 0;
|
|
8173
8785
|
return {
|
|
8174
8786
|
name,
|
|
@@ -8435,7 +9047,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8435
9047
|
try {
|
|
8436
9048
|
await this.followInstalledAddonToLatest(packageName, addonDir);
|
|
8437
9049
|
} catch (err) {
|
|
8438
|
-
const msg =
|
|
9050
|
+
const msg = require_scoped_settings.errMsg(err);
|
|
8439
9051
|
this.logger.error(`Failed to move ${packageName} to registry latest`, { meta: { error: msg } });
|
|
8440
9052
|
}
|
|
8441
9053
|
continue;
|
|
@@ -8472,7 +9084,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8472
9084
|
}
|
|
8473
9085
|
await this.installFromNpm(packageName);
|
|
8474
9086
|
} catch (err) {
|
|
8475
|
-
const msg =
|
|
9087
|
+
const msg = require_scoped_settings.errMsg(err);
|
|
8476
9088
|
if (packageName === "@camstack/server") throw new Error(`Required package ${packageName} failed to install: ${msg}`, { cause: err });
|
|
8477
9089
|
this.logger.error(`Failed to install ${packageName}`, { meta: { error: msg } });
|
|
8478
9090
|
}
|
|
@@ -8527,12 +9139,12 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8527
9139
|
if (this.serverVersion === void 0) return { kind: "ok" };
|
|
8528
9140
|
const serverVersion = this.serverVersion;
|
|
8529
9141
|
const unmetOf = (requires) => {
|
|
8530
|
-
const unmet =
|
|
9142
|
+
const unmet = require_rename_composition_block.unmetRequirements(requires, {
|
|
8531
9143
|
server: serverVersion,
|
|
8532
9144
|
addons: {},
|
|
8533
9145
|
wrapper: null
|
|
8534
9146
|
}).filter((u) => u.kind === "server-too-old");
|
|
8535
|
-
return unmet.length === 0 ? null : unmet.map(
|
|
9147
|
+
return unmet.length === 0 ? null : unmet.map(require_rename_composition_block.describeUnmet).join("; ");
|
|
8536
9148
|
};
|
|
8537
9149
|
const hold = (code, reason) => {
|
|
8538
9150
|
recordHeldInstall({
|
|
@@ -8574,7 +9186,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8574
9186
|
return hold("no-compatible-version", `latest ${unmet}, and no registry version of ${packageName} fits server ${serverVersion ?? "unknown (its version could not be read; a failed read is not a pass)"}`);
|
|
8575
9187
|
}
|
|
8576
9188
|
unreadableReason(err) {
|
|
8577
|
-
return `its requirements could not be read (${err instanceof RegistryReadError ? `${err.kind}: ${err.message}` :
|
|
9189
|
+
return `its requirements could not be read (${err instanceof RegistryReadError ? `${err.kind}: ${err.message}` : require_scoped_settings.errMsg(err)}); a failed read is not a pass`;
|
|
8578
9190
|
}
|
|
8579
9191
|
requiresRegistry() {
|
|
8580
9192
|
this.requiresRegistryCache ??= createRequiresRegistry({
|
|
@@ -8597,7 +9209,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8597
9209
|
if (this.resolveLatestVersionOverride) try {
|
|
8598
9210
|
return await this.resolveLatestVersionOverride(packageName);
|
|
8599
9211
|
} catch (err) {
|
|
8600
|
-
this.logger.warn(`${packageName} — registry unreadable, leaving the installed copy`, { meta: { error:
|
|
9212
|
+
this.logger.warn(`${packageName} — registry unreadable, leaving the installed copy`, { meta: { error: require_scoped_settings.errMsg(err) } });
|
|
8601
9213
|
return null;
|
|
8602
9214
|
}
|
|
8603
9215
|
return this.fetchRegistryLatest(packageName);
|
|
@@ -8614,7 +9226,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8614
9226
|
if (latest === null) this.logger.warn(`${packageName} — registry returned no dist-tags.latest, leaving the installed copy`);
|
|
8615
9227
|
return latest;
|
|
8616
9228
|
} catch (err) {
|
|
8617
|
-
this.logger.warn(`${packageName} — registry unreadable, leaving the installed copy`, { meta: { error:
|
|
9229
|
+
this.logger.warn(`${packageName} — registry unreadable, leaving the installed copy`, { meta: { error: require_scoped_settings.errMsg(err) } });
|
|
8618
9230
|
return null;
|
|
8619
9231
|
}
|
|
8620
9232
|
}
|
|
@@ -8693,7 +9305,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8693
9305
|
failed.push(pkg.name);
|
|
8694
9306
|
this.logger.error(`${pkg.name} — runtime dependencies could NOT be ensured; the addon will fail to load until its deps install`, { meta: {
|
|
8695
9307
|
dir: pkg.dir,
|
|
8696
|
-
error:
|
|
9308
|
+
error: require_scoped_settings.errMsg(err)
|
|
8697
9309
|
} });
|
|
8698
9310
|
}
|
|
8699
9311
|
}
|
|
@@ -8710,7 +9322,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8710
9322
|
*/
|
|
8711
9323
|
ensureOneAddonDeps(addonDir, packageName, closureNodeModules) {
|
|
8712
9324
|
const pkgView = readPackageJson(node_path.join(addonDir, "package.json"));
|
|
8713
|
-
const declared = pkgView === null ? null :
|
|
9325
|
+
const declared = pkgView === null ? null : require_wal_maintenance.asJsonObject(pkgView.raw["dependencies"]);
|
|
8714
9326
|
const declaredEntries = declared === null ? [] : Object.entries(declared);
|
|
8715
9327
|
const state = collectAddonTreeState(addonDir);
|
|
8716
9328
|
const nodeModulesDir = node_path.join(addonDir, "node_modules");
|
|
@@ -8839,7 +9451,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8839
9451
|
await copyExtraFileDirs(pkgData, sourceDir, targetDir);
|
|
8840
9452
|
copyBundledNativeModules(sourceDir, targetDir, this.logger);
|
|
8841
9453
|
await node_fs.promises.writeFile(node_path.join(targetDir, ".install-source"), "local");
|
|
8842
|
-
const localPkgVersion =
|
|
9454
|
+
const localPkgVersion = require_wal_maintenance.asString(pkgData.version, "0.0.0");
|
|
8843
9455
|
this.manifest.upsert(packageName, {
|
|
8844
9456
|
version: localPkgVersion,
|
|
8845
9457
|
source: "local"
|
|
@@ -8852,12 +9464,12 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8852
9464
|
"--ignore-scripts=false"
|
|
8853
9465
|
], this.npmRunOptions(targetDir, 12e4));
|
|
8854
9466
|
} catch (err) {
|
|
8855
|
-
this.logger.warn(`${packageName} — npm install failed (continuing)`, { meta: { error:
|
|
9467
|
+
this.logger.warn(`${packageName} — npm install failed (continuing)`, { meta: { error: require_scoped_settings.errMsg(err) } });
|
|
8856
9468
|
}
|
|
8857
9469
|
try {
|
|
8858
9470
|
await installManifestNativeDeps(targetDir, pkgData, this.logger, this.registry, this.npmCacheDir);
|
|
8859
9471
|
} catch (err) {
|
|
8860
|
-
this.logger.warn(`${packageName} — native deps install failed (continuing)`, { meta: { error:
|
|
9472
|
+
this.logger.warn(`${packageName} — native deps install failed (continuing)`, { meta: { error: require_scoped_settings.errMsg(err) } });
|
|
8861
9473
|
}
|
|
8862
9474
|
await ensureAddonNativePrebuilds(targetDir, {
|
|
8863
9475
|
addonName: packageName,
|
|
@@ -8989,7 +9601,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8989
9601
|
}).catch((cleanupErr) => {
|
|
8990
9602
|
this.logger.debug("evictInstallDir: aside cleanup deferred (likely held open)", { meta: {
|
|
8991
9603
|
asideDir,
|
|
8992
|
-
error:
|
|
9604
|
+
error: require_scoped_settings.errMsg(cleanupErr)
|
|
8993
9605
|
} });
|
|
8994
9606
|
});
|
|
8995
9607
|
}
|
|
@@ -9087,7 +9699,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9087
9699
|
}
|
|
9088
9700
|
const strippedManifest = stripBundledDeps(pkgView.raw);
|
|
9089
9701
|
await node_fs.promises.writeFile(pkgJsonPath, JSON.stringify(strippedManifest, null, 2));
|
|
9090
|
-
const deps =
|
|
9702
|
+
const deps = require_wal_maintenance.asJsonObject(strippedManifest["dependencies"]);
|
|
9091
9703
|
const depNames = deps ? Object.keys(deps) : [];
|
|
9092
9704
|
if (depNames.length === 0) return;
|
|
9093
9705
|
this.logger.info(`${packageName} — installing runtime dependencies`, { meta: {
|
|
@@ -9108,9 +9720,9 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9108
9720
|
this.logger.error(`${packageName} — runtime dependency install FAILED; update ABORTED (a swapped-in copy would fail every load with "Cannot find module")`, { meta: {
|
|
9109
9721
|
pkgDir,
|
|
9110
9722
|
dependencies: depNames,
|
|
9111
|
-
error:
|
|
9723
|
+
error: require_scoped_settings.errMsg(err)
|
|
9112
9724
|
} });
|
|
9113
|
-
throw new Error(`${packageName} — runtime dependency install failed: ${
|
|
9725
|
+
throw new Error(`${packageName} — runtime dependency install failed: ${require_scoped_settings.errMsg(err)}`, { cause: err });
|
|
9114
9726
|
}
|
|
9115
9727
|
}
|
|
9116
9728
|
/**
|
|
@@ -9159,9 +9771,9 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9159
9771
|
} catch (nativeErr) {
|
|
9160
9772
|
this.logger.error(`${packageName} — native dependency install FAILED; install ABORTED (a swapped-in copy would fail every load at the binding)`, { meta: {
|
|
9161
9773
|
pkgDir,
|
|
9162
|
-
error:
|
|
9774
|
+
error: require_scoped_settings.errMsg(nativeErr)
|
|
9163
9775
|
} });
|
|
9164
|
-
throw new Error(`${packageName} — native deps install failed: ${
|
|
9776
|
+
throw new Error(`${packageName} — native deps install failed: ${require_scoped_settings.errMsg(nativeErr)}`, { cause: nativeErr });
|
|
9165
9777
|
}
|
|
9166
9778
|
await ensureAddonNativePrebuilds(pkgDir, {
|
|
9167
9779
|
addonName: packageName,
|
|
@@ -9199,7 +9811,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9199
9811
|
const refused = plan.keeps.filter((k) => k.reason === "version-incompatible");
|
|
9200
9812
|
if (refused.length > 0) this.logger.info(`${packageName} — kept own copy where the closure version is incompatible`, { meta: { kept: refused.map((k) => k.name) } });
|
|
9201
9813
|
} catch (err) {
|
|
9202
|
-
this.logger.warn(`${packageName} — closure dedupe failed (copies kept)`, { meta: { error:
|
|
9814
|
+
this.logger.warn(`${packageName} — closure dedupe failed (copies kept)`, { meta: { error: require_scoped_settings.errMsg(err) } });
|
|
9203
9815
|
}
|
|
9204
9816
|
}
|
|
9205
9817
|
/** Install addon from a tgz file (uploaded or downloaded) */
|
|
@@ -9282,7 +9894,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9282
9894
|
try {
|
|
9283
9895
|
result = await this.installFromNpm(packageName, version);
|
|
9284
9896
|
} catch (installErr) {
|
|
9285
|
-
this.logger.error(`${packageName} — install failed, restoring backup`, { meta: { error:
|
|
9897
|
+
this.logger.error(`${packageName} — install failed, restoring backup`, { meta: { error: require_scoped_settings.errMsg(installErr) } });
|
|
9286
9898
|
try {
|
|
9287
9899
|
if (node_fs.existsSync(addonDir)) node_fs.rmSync(addonDir, {
|
|
9288
9900
|
recursive: true,
|
|
@@ -9297,7 +9909,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9297
9909
|
} catch (restoreErr) {
|
|
9298
9910
|
this.logger.error(`${packageName} — backup restore ALSO failed; manual recovery needed`, { meta: {
|
|
9299
9911
|
backupDir,
|
|
9300
|
-
error:
|
|
9912
|
+
error: require_scoped_settings.errMsg(restoreErr)
|
|
9301
9913
|
} });
|
|
9302
9914
|
}
|
|
9303
9915
|
throw installErr;
|
|
@@ -9372,7 +9984,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9372
9984
|
} else throw renameErr;
|
|
9373
9985
|
}
|
|
9374
9986
|
} catch (swapErr) {
|
|
9375
|
-
this.logger.error(`${packageName} — staged swap failed, restoring backup`, { meta: { error:
|
|
9987
|
+
this.logger.error(`${packageName} — staged swap failed, restoring backup`, { meta: { error: require_scoped_settings.errMsg(swapErr) } });
|
|
9376
9988
|
try {
|
|
9377
9989
|
if (node_fs.existsSync(addonDir)) node_fs.rmSync(addonDir, {
|
|
9378
9990
|
recursive: true,
|
|
@@ -9387,7 +9999,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9387
9999
|
} catch (restoreErr) {
|
|
9388
10000
|
this.logger.error(`${packageName} — backup restore ALSO failed; manual recovery needed`, { meta: {
|
|
9389
10001
|
backupDir,
|
|
9390
|
-
error:
|
|
10002
|
+
error: require_scoped_settings.errMsg(restoreErr)
|
|
9391
10003
|
} });
|
|
9392
10004
|
}
|
|
9393
10005
|
throw swapErr;
|
|
@@ -9487,7 +10099,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9487
10099
|
this.logger.warn("Backup removal failed; leaving residue for the next boot sweep", { meta: {
|
|
9488
10100
|
target,
|
|
9489
10101
|
reason,
|
|
9490
|
-
error:
|
|
10102
|
+
error: require_scoped_settings.errMsg(err)
|
|
9491
10103
|
} });
|
|
9492
10104
|
return false;
|
|
9493
10105
|
}
|
|
@@ -9554,7 +10166,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9554
10166
|
lastBackupDir: void 0
|
|
9555
10167
|
});
|
|
9556
10168
|
} catch (err) {
|
|
9557
|
-
this.logger.warn(`${packageName} — could not clear the backup pointer`, { meta: { error:
|
|
10169
|
+
this.logger.warn(`${packageName} — could not clear the backup pointer`, { meta: { error: require_scoped_settings.errMsg(err) } });
|
|
9558
10170
|
}
|
|
9559
10171
|
await this.removeEmptyBackupDirs(packageName);
|
|
9560
10172
|
}
|
|
@@ -9713,8 +10325,8 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9713
10325
|
]) {
|
|
9714
10326
|
const candidate = node_path.join(this.bundledAddonsDir, dirName);
|
|
9715
10327
|
try {
|
|
9716
|
-
const pkg =
|
|
9717
|
-
if (pkg &&
|
|
10328
|
+
const pkg = require_wal_maintenance.asJsonObject(require_wal_maintenance.parseJsonUnknown(node_fs.readFileSync(node_path.join(candidate, "package.json"), "utf-8")));
|
|
10329
|
+
if (pkg && require_wal_maintenance.asString(pkg["name"]) === packageName) return candidate;
|
|
9718
10330
|
} catch {}
|
|
9719
10331
|
}
|
|
9720
10332
|
return null;
|
|
@@ -9727,7 +10339,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9727
10339
|
try {
|
|
9728
10340
|
await runNpm(["run", "build"], this.npmRunOptions(sourceDir, 18e4));
|
|
9729
10341
|
} catch (err) {
|
|
9730
|
-
const msg =
|
|
10342
|
+
const msg = require_scoped_settings.errMsg(err);
|
|
9731
10343
|
this.logger.warn(`${packageName} auto-build failed`, { meta: { error: msg } });
|
|
9732
10344
|
}
|
|
9733
10345
|
}
|
|
@@ -10017,7 +10629,7 @@ function readPendingRestart(dataDir) {
|
|
|
10017
10629
|
}
|
|
10018
10630
|
let parsed;
|
|
10019
10631
|
try {
|
|
10020
|
-
parsed =
|
|
10632
|
+
parsed = require_wal_maintenance.asJsonObject(require_wal_maintenance.parseJsonUnknown(raw));
|
|
10021
10633
|
} catch (err) {
|
|
10022
10634
|
console.error("[restart-coordinator] Marker JSON invalid — clearing:", err);
|
|
10023
10635
|
clearPendingRestart(dataDir);
|
|
@@ -10028,8 +10640,8 @@ function readPendingRestart(dataDir) {
|
|
|
10028
10640
|
clearPendingRestart(dataDir);
|
|
10029
10641
|
return null;
|
|
10030
10642
|
}
|
|
10031
|
-
const kindRaw =
|
|
10032
|
-
const requestedAt =
|
|
10643
|
+
const kindRaw = require_wal_maintenance.asString(parsed["kind"]);
|
|
10644
|
+
const requestedAt = require_wal_maintenance.asNumber(parsed["requestedAt"]);
|
|
10033
10645
|
if (!isRestartKind(kindRaw) || requestedAt <= 0) {
|
|
10034
10646
|
console.error("[restart-coordinator] Marker missing kind/requestedAt — clearing");
|
|
10035
10647
|
clearPendingRestart(dataDir);
|
|
@@ -11560,23 +12172,23 @@ function systemMountKindFor(def) {
|
|
|
11560
12172
|
function methodMountKindFor(def, mountKind, method) {
|
|
11561
12173
|
if (method.schema.systemOnly === true) return systemMountKindFor(def);
|
|
11562
12174
|
if (mountKind !== "device-scoped") return mountKind;
|
|
11563
|
-
if (
|
|
12175
|
+
if (require_rename_composition_block.objectInputDeclaresRequiredDeviceId(method.schema.input)) return mountKind;
|
|
11564
12176
|
return systemMountKindFor(def);
|
|
11565
12177
|
}
|
|
11566
12178
|
function methodsFor(def) {
|
|
11567
|
-
const effective =
|
|
12179
|
+
const effective = require_capability_definition.expandCapMethods(def);
|
|
11568
12180
|
return Object.entries(effective).map(([name, schema]) => {
|
|
11569
12181
|
const m = schema;
|
|
11570
12182
|
return {
|
|
11571
12183
|
name,
|
|
11572
12184
|
kind: m.kind ?? "query",
|
|
11573
|
-
auth:
|
|
12185
|
+
auth: require_rename_composition_block.resolveMethodAuth(def, m),
|
|
11574
12186
|
schema: m,
|
|
11575
|
-
isVoid:
|
|
11576
|
-
isObject:
|
|
12187
|
+
isVoid: require_rename_composition_block.isVoidInput(m.input),
|
|
12188
|
+
isObject: require_rename_composition_block.isObjectInput(m.input),
|
|
11577
12189
|
callerRequired: m.caller === "required",
|
|
11578
12190
|
callerScoped: m.caller === "scoped",
|
|
11579
|
-
isArrayOutput: m.kind !== "subscription" &&
|
|
12191
|
+
isArrayOutput: m.kind !== "subscription" && require_rename_composition_block.isArrayOutputSchema(m.output)
|
|
11580
12192
|
};
|
|
11581
12193
|
});
|
|
11582
12194
|
}
|
|
@@ -11730,7 +12342,7 @@ function requireLocal(capName, getLocal, services) {
|
|
|
11730
12342
|
*/
|
|
11731
12343
|
function buildOneCapRouter(def, primitives, services) {
|
|
11732
12344
|
const capName = def.name;
|
|
11733
|
-
const mount =
|
|
12345
|
+
const mount = require_capability_definition.resolveCapMount(def);
|
|
11734
12346
|
const nodeIdData = def.nodeIdMode === "data";
|
|
11735
12347
|
const procedures = {};
|
|
11736
12348
|
for (const method of methodsFor(def)) {
|
|
@@ -11739,7 +12351,7 @@ function buildOneCapRouter(def, primitives, services) {
|
|
|
11739
12351
|
const isCollection = effectiveMountKind === "collection";
|
|
11740
12352
|
if (method.callerScoped && (!isCollection || nodeIdData)) throw new Error(`Cap "${capName}" method "${method.name}": caller: 'scoped' needs a collection cap`);
|
|
11741
12353
|
const getLocal = (ctx, addonId) => services.getLocalProvider(capName, effectiveMountKind, ctx, addonId);
|
|
11742
|
-
const base = primitives.procedures[
|
|
12354
|
+
const base = primitives.procedures[require_rename_composition_block.procedureAuthKey(method.auth)];
|
|
11743
12355
|
const inputSchema = method.schema.input;
|
|
11744
12356
|
if (method.kind === "subscription") {
|
|
11745
12357
|
procedures[method.name] = base.input(inputSchema).subscription(({ input, ctx }) => {
|
|
@@ -11765,19 +12377,19 @@ function buildOneCapRouter(def, primitives, services) {
|
|
|
11765
12377
|
continue;
|
|
11766
12378
|
}
|
|
11767
12379
|
if (method.isObject) {
|
|
11768
|
-
const stampedCap =
|
|
11769
|
-
const routed = nodeIdData ? inputSchema :
|
|
12380
|
+
const stampedCap = CALLER_STAMPED_CAPABILITIES$2.includes(capName);
|
|
12381
|
+
const routed = nodeIdData ? inputSchema : require_rename_composition_block.looseSchema(inputSchema);
|
|
11770
12382
|
const schema = method.callerScoped && routed instanceof zod.z.ZodType && routed.safeParse({}).success ? routed.optional() : routed;
|
|
11771
12383
|
procedures[method.name] = base.input(schema)[procKind](({ input: wireInput, ctx }) => {
|
|
11772
12384
|
const hasHttpReq = typeof ctx === "object" && ctx !== null && "req" in ctx && ctx.req !== void 0;
|
|
11773
|
-
const input = stampedCap && hasHttpReq ?
|
|
12385
|
+
const input = stampedCap && hasHttpReq ? withoutCallerStamp(wireInput) : wireInput;
|
|
11774
12386
|
if (nodeIdData) return invokeCapMethod(requireLocal(capName, () => getLocal(ctx), services), method, method.callerRequired ? injectCaller(stripKeys(input, []).rest, ctx, capName, method.name, services) : input, capName, isCollection, services);
|
|
11775
12387
|
if (isCollection) {
|
|
11776
12388
|
const { rest, picked } = stripKeys(input, ["nodeId", "addonId"]);
|
|
11777
12389
|
const nodeId = typeof picked.nodeId === "string" ? picked.nodeId : void 0;
|
|
11778
12390
|
const topLevelAddonId = typeof picked.addonId === "string" ? picked.addonId : void 0;
|
|
11779
|
-
const canRecoverNestedAddonId = !
|
|
11780
|
-
let addonId = topLevelAddonId ?? (canRecoverNestedAddonId ?
|
|
12391
|
+
const canRecoverNestedAddonId = !require_rename_composition_block.isArrayOutputSchema(method.schema.output) && !require_rename_composition_block.objectInputDeclaresAddonId(method.schema.input);
|
|
12392
|
+
let addonId = topLevelAddonId ?? (canRecoverNestedAddonId ? require_rename_composition_block.extractNestedAddonId(rest) : void 0);
|
|
11781
12393
|
const resolveAndInvoke = async () => {
|
|
11782
12394
|
let refusePin = topLevelAddonId;
|
|
11783
12395
|
if (addonId === void 0 && !method.isArrayOutput && services.inferCollectionAddonPin) {
|
|
@@ -11820,21 +12432,21 @@ function isBuilderMounted(kind) {
|
|
|
11820
12432
|
*/
|
|
11821
12433
|
function buildCapRouters(primitives, services) {
|
|
11822
12434
|
const out = {};
|
|
11823
|
-
for (const def of
|
|
11824
|
-
if (!isBuilderMounted(
|
|
11825
|
-
const effective =
|
|
12435
|
+
for (const def of require_rename_composition_block.ALL_CAPABILITY_DEFINITIONS) {
|
|
12436
|
+
if (!isBuilderMounted(require_capability_definition.resolveCapMount(def).kind)) continue;
|
|
12437
|
+
const effective = require_capability_definition.expandCapMethods(def);
|
|
11826
12438
|
if (Object.keys(effective).length === 0) continue;
|
|
11827
|
-
out[
|
|
12439
|
+
out[require_rename_composition_block.kebabToCamel(def.name)] = buildOneCapRouter(def, primitives, services);
|
|
11828
12440
|
}
|
|
11829
12441
|
return out;
|
|
11830
12442
|
}
|
|
11831
12443
|
/** The set of cap camelNames the builder owns (for drift checks / tests). */
|
|
11832
12444
|
function builderMountedCapNames() {
|
|
11833
12445
|
const names = [];
|
|
11834
|
-
for (const def of
|
|
11835
|
-
if (!isBuilderMounted(
|
|
11836
|
-
if (Object.keys(
|
|
11837
|
-
names.push(
|
|
12446
|
+
for (const def of require_rename_composition_block.ALL_CAPABILITY_DEFINITIONS) {
|
|
12447
|
+
if (!isBuilderMounted(require_capability_definition.resolveCapMount(def).kind)) continue;
|
|
12448
|
+
if (Object.keys(require_capability_definition.expandCapMethods(def)).length === 0) continue;
|
|
12449
|
+
names.push(require_rename_composition_block.kebabToCamel(def.name));
|
|
11838
12450
|
}
|
|
11839
12451
|
return names;
|
|
11840
12452
|
}
|
|
@@ -12425,7 +13037,7 @@ var ConfigManager = class {
|
|
|
12425
13037
|
if (bootstrapValue !== void 0) return bootstrapValue;
|
|
12426
13038
|
const storeValue = this.readStoreLayer(configPath);
|
|
12427
13039
|
if (storeValue !== void 0) return storeValue;
|
|
12428
|
-
if (configPath in
|
|
13040
|
+
if (configPath in require_constants.RUNTIME_DEFAULTS) return require_constants.RUNTIME_DEFAULTS[configPath];
|
|
12429
13041
|
return this.getFromRuntimeDefaults(configPath) ?? void 0;
|
|
12430
13042
|
}
|
|
12431
13043
|
/**
|
|
@@ -12696,7 +13308,7 @@ var ConfigManager = class {
|
|
|
12696
13308
|
const g = (key) => {
|
|
12697
13309
|
const storeValue = this.settingsStore !== null ? this.get(`features.${key}`) : void 0;
|
|
12698
13310
|
if (typeof storeValue === "boolean") return storeValue;
|
|
12699
|
-
return
|
|
13311
|
+
return require_constants.RUNTIME_DEFAULTS[`features.${key}`];
|
|
12700
13312
|
};
|
|
12701
13313
|
return {
|
|
12702
13314
|
streaming: g("streaming"),
|
|
@@ -12723,7 +13335,7 @@ var ConfigManager = class {
|
|
|
12723
13335
|
const prefix = configPath + ".";
|
|
12724
13336
|
const result = {};
|
|
12725
13337
|
let found = false;
|
|
12726
|
-
for (const [key, value] of Object.entries(
|
|
13338
|
+
for (const [key, value] of Object.entries(require_constants.RUNTIME_DEFAULTS)) if (key.startsWith(prefix)) {
|
|
12727
13339
|
const subKey = key.slice(prefix.length);
|
|
12728
13340
|
result[subKey] = value;
|
|
12729
13341
|
found = true;
|
|
@@ -22606,7 +23218,7 @@ var HubLogForwarder = class {
|
|
|
22606
23218
|
tags: mergedTags,
|
|
22607
23219
|
...entry.meta !== void 0 ? { meta: entry.meta } : {}
|
|
22608
23220
|
}).catch((err) => {
|
|
22609
|
-
console.error(`[HubLogForwarder] $hub.log call failed: ${
|
|
23221
|
+
console.error(`[HubLogForwarder] $hub.log call failed: ${require_scoped_settings.errMsg(err)}`);
|
|
22610
23222
|
});
|
|
22611
23223
|
}
|
|
22612
23224
|
async shutdown() {
|
|
@@ -23244,7 +23856,7 @@ function localHardwareInfo() {
|
|
|
23244
23856
|
}
|
|
23245
23857
|
/** Runtime ids offered on this host (`onnx`, `openvino`, `coreml`, `edgetpu`). */
|
|
23246
23858
|
function localSupportedPythonRuntimes() {
|
|
23247
|
-
return
|
|
23859
|
+
return require_coral_accelerators.supportedRuntimes(localHardwareInfo());
|
|
23248
23860
|
}
|
|
23249
23861
|
//#endregion
|
|
23250
23862
|
//#region src/kernel/deps/manifest-python-deps.ts
|
|
@@ -23702,7 +24314,7 @@ var AddonHealthMonitor = class {
|
|
|
23702
24314
|
alertEmitted: false,
|
|
23703
24315
|
retrying: false
|
|
23704
24316
|
});
|
|
23705
|
-
if (wasAlerting) this.emit(
|
|
24317
|
+
if (wasAlerting) this.emit(require_base_addon.EventCategory.AddonLoadRecovered, {
|
|
23706
24318
|
packageName,
|
|
23707
24319
|
addonId: addonId ?? existing?.addonId,
|
|
23708
24320
|
retryCount: existing.retryCount
|
|
@@ -23720,7 +24332,7 @@ var AddonHealthMonitor = class {
|
|
|
23720
24332
|
const intervalIdx = Math.min(retryCount - 1, this.retryIntervalsMs.length - 1);
|
|
23721
24333
|
const nextRetryAt = t + this.retryIntervalsMs[intervalIdx];
|
|
23722
24334
|
const errPayload = {
|
|
23723
|
-
message:
|
|
24335
|
+
message: require_scoped_settings.errMsg(err),
|
|
23724
24336
|
...err instanceof Error && err.stack ? { stack: err.stack } : {}
|
|
23725
24337
|
};
|
|
23726
24338
|
const next = {
|
|
@@ -23744,7 +24356,7 @@ var AddonHealthMonitor = class {
|
|
|
23744
24356
|
inGrace: this.inGracePeriod(),
|
|
23745
24357
|
error: errPayload.message
|
|
23746
24358
|
} });
|
|
23747
|
-
this.emit(
|
|
24359
|
+
this.emit(require_base_addon.EventCategory.AddonRetryScheduled, {
|
|
23748
24360
|
packageName,
|
|
23749
24361
|
addonId: next.addonId,
|
|
23750
24362
|
retryCount,
|
|
@@ -23752,7 +24364,7 @@ var AddonHealthMonitor = class {
|
|
|
23752
24364
|
});
|
|
23753
24365
|
if (!this.inGracePeriod() && !next.alertEmitted) {
|
|
23754
24366
|
next.alertEmitted = true;
|
|
23755
|
-
this.emit(
|
|
24367
|
+
this.emit(require_base_addon.EventCategory.AddonLoadFailed, {
|
|
23756
24368
|
packageName,
|
|
23757
24369
|
addonId: next.addonId,
|
|
23758
24370
|
error: errPayload,
|
|
@@ -23840,7 +24452,7 @@ var AddonHealthMonitor = class {
|
|
|
23840
24452
|
this.graceEmittedFor = true;
|
|
23841
24453
|
for (const s of this.state.values()) if (s.phase === "failed" && !s.alertEmitted && s.lastError) {
|
|
23842
24454
|
s.alertEmitted = true;
|
|
23843
|
-
this.emit(
|
|
24455
|
+
this.emit(require_base_addon.EventCategory.AddonLoadFailed, {
|
|
23844
24456
|
packageName: s.packageName,
|
|
23845
24457
|
addonId: s.addonId,
|
|
23846
24458
|
error: s.lastError,
|
|
@@ -23857,7 +24469,7 @@ var AddonHealthMonitor = class {
|
|
|
23857
24469
|
const existing = this.state.get(packageName);
|
|
23858
24470
|
if (!existing) return;
|
|
23859
24471
|
existing.retrying = true;
|
|
23860
|
-
this.emit(
|
|
24472
|
+
this.emit(require_base_addon.EventCategory.AddonRetryAttempting, {
|
|
23861
24473
|
packageName,
|
|
23862
24474
|
addonId: existing.addonId,
|
|
23863
24475
|
retryCount: existing.retryCount
|
|
@@ -23984,7 +24596,7 @@ var UnsupportedAddonTracker = class {
|
|
|
23984
24596
|
}
|
|
23985
24597
|
this.pendingClear.delete(packageName);
|
|
23986
24598
|
this.options.log(`[unsupported-addon] ${streak.facts.addonId} (${packageName}) is supported again, alert cleared`);
|
|
23987
|
-
this.emit(
|
|
24599
|
+
this.emit(require_base_addon.EventCategory.AddonUnsupportedResolved, {
|
|
23988
24600
|
packageName,
|
|
23989
24601
|
addonId: streak.facts.addonId,
|
|
23990
24602
|
nodeId: this.options.nodeId
|
|
@@ -24006,7 +24618,7 @@ var UnsupportedAddonTracker = class {
|
|
|
24006
24618
|
for (const packageName of [...this.pendingClear]) {
|
|
24007
24619
|
this.pendingClear.delete(packageName);
|
|
24008
24620
|
this.announcedSupported.add(packageName);
|
|
24009
|
-
this.emit(
|
|
24621
|
+
this.emit(require_base_addon.EventCategory.AddonUnsupportedResolved, {
|
|
24010
24622
|
packageName,
|
|
24011
24623
|
nodeId: this.options.nodeId
|
|
24012
24624
|
});
|
|
@@ -24015,7 +24627,7 @@ var UnsupportedAddonTracker = class {
|
|
|
24015
24627
|
if (streak.raised) continue;
|
|
24016
24628
|
streak.raised = true;
|
|
24017
24629
|
const f = streak.facts;
|
|
24018
|
-
this.emit(
|
|
24630
|
+
this.emit(require_base_addon.EventCategory.AddonUnsupportedVersion, {
|
|
24019
24631
|
packageName: f.packageName,
|
|
24020
24632
|
addonId: f.addonId,
|
|
24021
24633
|
nodeId: this.options.nodeId,
|
|
@@ -24817,7 +25429,7 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
24817
25429
|
*/
|
|
24818
25430
|
function emitRunnerEvent(category, sourceId, data) {
|
|
24819
25431
|
if (!capturedBroker) return;
|
|
24820
|
-
getBrokerEventBus(capturedBroker).emit(
|
|
25432
|
+
getBrokerEventBus(capturedBroker).emit(require_base_addon.createEvent(category, {
|
|
24821
25433
|
type: "core",
|
|
24822
25434
|
id: sourceId,
|
|
24823
25435
|
nodeId: parentNodeId
|
|
@@ -24829,7 +25441,7 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
24829
25441
|
* boot check re-evaluates on it and the alert centre closes a recovered runner.
|
|
24830
25442
|
*/
|
|
24831
25443
|
function emitStateChange(entry) {
|
|
24832
|
-
emitRunnerEvent(
|
|
25444
|
+
emitRunnerEvent(require_base_addon.EventCategory.ProcessStateChanged, entry.name, {
|
|
24833
25445
|
runnerId: entry.name,
|
|
24834
25446
|
nodeId: parentNodeId,
|
|
24835
25447
|
addonIds: entry.runnerAddons.map((addon) => addon.addonId),
|
|
@@ -24991,7 +25603,7 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
24991
25603
|
capturedBroker?.logger.error(`[${runnerId}] Addon refused to start (${refusal.code}): ${refusal.reason} Not respawning; ${refusal.remedy}`, { tags: { runnerId } });
|
|
24992
25604
|
processes.set(runnerId, entry);
|
|
24993
25605
|
if (capturedBroker) forceMoleculerDisconnect(capturedBroker, entry.nodeId);
|
|
24994
|
-
emitRunnerEvent(
|
|
25606
|
+
emitRunnerEvent(require_base_addon.EventCategory.AddonRunnerRefused, runnerId, {
|
|
24995
25607
|
runnerId,
|
|
24996
25608
|
nodeId: parentNodeId,
|
|
24997
25609
|
addonIds: entry.runnerAddons.map((addon) => addon.addonId),
|
|
@@ -25009,7 +25621,7 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
25009
25621
|
if (code === 0 && signal === null) capturedBroker?.logger.warn(`${exitLine} — unexpected clean exit, respawning`, { tags: { runnerId } });
|
|
25010
25622
|
else capturedBroker?.logger.error(exitLine, { tags: { runnerId } });
|
|
25011
25623
|
const decision = crashSupervisor.recordCrash(runnerId);
|
|
25012
|
-
emitRunnerEvent(
|
|
25624
|
+
emitRunnerEvent(require_base_addon.EventCategory.ProcessCrashed, runnerId, {
|
|
25013
25625
|
processId: runnerId,
|
|
25014
25626
|
exitCode: code ?? void 0,
|
|
25015
25627
|
signal: signal ?? void 0
|
|
@@ -25021,7 +25633,7 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
25021
25633
|
capturedBroker?.logger.error(`[${runnerId}] Crash circuit-breaker tripped — ${decision.crashesInWindow} crashes in ${CRASH_WINDOW_MS}ms. Not respawning.`);
|
|
25022
25634
|
processes.set(runnerId, entry);
|
|
25023
25635
|
if (capturedBroker) forceMoleculerDisconnect(capturedBroker, entry.nodeId);
|
|
25024
|
-
emitRunnerEvent(
|
|
25636
|
+
emitRunnerEvent(require_base_addon.EventCategory.AddonRunnerFailed, runnerId, {
|
|
25025
25637
|
runnerId,
|
|
25026
25638
|
nodeId: parentNodeId,
|
|
25027
25639
|
addonIds: entry.runnerAddons.map((addon) => addon.addonId),
|
|
@@ -25032,14 +25644,14 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
25032
25644
|
...code !== null ? { exitCode: code } : {},
|
|
25033
25645
|
...signal !== null ? { signal } : {}
|
|
25034
25646
|
});
|
|
25035
|
-
for (const addon of entry.runnerAddons) emitRunnerEvent(
|
|
25647
|
+
for (const addon of entry.runnerAddons) emitRunnerEvent(require_base_addon.EventCategory.AddonCrashed, addon.addonId, {
|
|
25036
25648
|
addonId: addon.addonId,
|
|
25037
25649
|
error: `${require_builtins_alerts_alerts_addon.CRASH_BREAKER_ERROR_PREFIX} after ${decision.crashesInWindow} crashes in ${CRASH_WINDOW_MS}ms`
|
|
25038
25650
|
});
|
|
25039
25651
|
return;
|
|
25040
25652
|
}
|
|
25041
25653
|
capturedBroker?.logger.warn(`[${runnerId}] Restart scheduled (attempt #${decision.crashesInWindow}, backoff ${decision.backoffMs}ms)...`);
|
|
25042
|
-
emitRunnerEvent(
|
|
25654
|
+
emitRunnerEvent(require_base_addon.EventCategory.ProcessRestartScheduled, runnerId, {
|
|
25043
25655
|
processId: runnerId,
|
|
25044
25656
|
delayMs: decision.backoffMs
|
|
25045
25657
|
});
|
|
@@ -25478,7 +26090,7 @@ var JobJournal = class {
|
|
|
25478
26090
|
}
|
|
25479
26091
|
getJob(id) {
|
|
25480
26092
|
try {
|
|
25481
|
-
const parsed =
|
|
26093
|
+
const parsed = require_rename_composition_block.lifecycleJobSchema.safeParse(JSON.parse(node_fs.readFileSync(this.jobPath(id), "utf-8")));
|
|
25482
26094
|
return parsed.success ? parsed.data : null;
|
|
25483
26095
|
} catch {
|
|
25484
26096
|
return null;
|
|
@@ -26391,7 +27003,7 @@ var CatalogRegistry = class {
|
|
|
26391
27003
|
}
|
|
26392
27004
|
/** Validates `raw` and installs it; returns false (after warning) when it is not a flat string map. */
|
|
26393
27005
|
set(ns, lang, raw, origin) {
|
|
26394
|
-
const parsed =
|
|
27006
|
+
const parsed = CatalogFileSchema.safeParse(raw);
|
|
26395
27007
|
if (!parsed.success) {
|
|
26396
27008
|
this.warn(`i18n catalog ignored (${origin}): ${parsed.error.issues[0]?.message ?? "invalid"}`);
|
|
26397
27009
|
return false;
|
|
@@ -26403,7 +27015,7 @@ var CatalogRegistry = class {
|
|
|
26403
27015
|
}
|
|
26404
27016
|
/** Loads `<packageDir>/i18n/<lang>.json` for every language that has a file. */
|
|
26405
27017
|
loadAddonDir(ns, packageDir) {
|
|
26406
|
-
for (const lang of
|
|
27018
|
+
for (const lang of CATALOG_LANGS) {
|
|
26407
27019
|
const file = node_path.join(packageDir, "i18n", `${lang}.json`);
|
|
26408
27020
|
let text;
|
|
26409
27021
|
try {
|
|
@@ -26432,7 +27044,7 @@ var CatalogRegistry = class {
|
|
|
26432
27044
|
* fallback IS the English text.
|
|
26433
27045
|
*/
|
|
26434
27046
|
t(lang, ns, key, params, fallbackEnglish) {
|
|
26435
|
-
return
|
|
27047
|
+
return interpolate((lang === "en" ? void 0 : this.lookup(lang, ns, key)) ?? fallbackEnglish, params);
|
|
26436
27048
|
}
|
|
26437
27049
|
/** A lookup bound to one language, for `localizeConfigTree`. English never substitutes. */
|
|
26438
27050
|
lookupFor(lang) {
|
|
@@ -26440,8 +27052,8 @@ var CatalogRegistry = class {
|
|
|
26440
27052
|
}
|
|
26441
27053
|
/** `t` for a `"ns:key"` reference. */
|
|
26442
27054
|
tRef(lang, ref, params, fallbackEnglish) {
|
|
26443
|
-
const parts =
|
|
26444
|
-
return parts === null ?
|
|
27055
|
+
const parts = splitTranslationRef(ref);
|
|
27056
|
+
return parts === null ? interpolate(fallbackEnglish, params) : this.t(lang, parts.ns, parts.key, params, fallbackEnglish);
|
|
26445
27057
|
}
|
|
26446
27058
|
};
|
|
26447
27059
|
var shared = null;
|
|
@@ -26476,7 +27088,7 @@ exports.AGENT_UI_UNLOCK_TTL_MS = require_builtins_system_config_system_config_ad
|
|
|
26476
27088
|
exports.AGENT_UI_UNLOCK_TYP = require_builtins_system_config_system_config_addon.AGENT_UI_UNLOCK_TYP;
|
|
26477
27089
|
exports.AGENT_UI_UNLOCK_USE = require_builtins_system_config_system_config_addon.AGENT_UI_UNLOCK_USE;
|
|
26478
27090
|
exports.AGENT_UI_UNLOCK_VERSION = require_builtins_system_config_system_config_addon.AGENT_UI_UNLOCK_VERSION;
|
|
26479
|
-
exports.ALL_CAPABILITY_DEFINITIONS =
|
|
27091
|
+
exports.ALL_CAPABILITY_DEFINITIONS = require_rename_composition_block.ALL_CAPABILITY_DEFINITIONS;
|
|
26480
27092
|
exports.ARRAY_BUFFER_CENSUS_COOLDOWN_MS = ARRAY_BUFFER_CENSUS_COOLDOWN_MS;
|
|
26481
27093
|
exports.ARRAY_BUFFER_CENSUS_SUSTAIN_MS = ARRAY_BUFFER_CENSUS_SUSTAIN_MS;
|
|
26482
27094
|
exports.ARRAY_BUFFER_CENSUS_THRESHOLD_MB = ARRAY_BUFFER_CENSUS_THRESHOLD_MB;
|
|
@@ -26530,12 +27142,12 @@ exports.CoreNotifierAddon = require_builtins_core_notifier_core_notifier_addon.C
|
|
|
26530
27142
|
exports.CustomActionRegistry = require_custom_action_registry.CustomActionRegistry;
|
|
26531
27143
|
exports.DECISIVE_HEAP_SPACES = DECISIVE_HEAP_SPACES;
|
|
26532
27144
|
exports.DEFAULT_DATA_PATH = DEFAULT_DATA_PATH;
|
|
26533
|
-
exports.DEFAULT_HUB_TLS_TCP_PORT = require_constants.DEFAULT_HUB_TLS_TCP_PORT;
|
|
27145
|
+
exports.DEFAULT_HUB_TLS_TCP_PORT = require_constants$1.DEFAULT_HUB_TLS_TCP_PORT;
|
|
26534
27146
|
exports.DEFAULT_LAN_HTTP_PORT = require_hub_mdns_ciao.DEFAULT_LAN_HTTP_PORT;
|
|
26535
27147
|
exports.DEFAULT_LOG_LEVEL = DEFAULT_LOG_LEVEL;
|
|
26536
27148
|
exports.DEVICE_CA_KEY_REF = require_device_ca.DEVICE_CA_KEY_REF;
|
|
26537
|
-
exports.DEVICE_SETTINGS_CONTRIBUTION_METHODS =
|
|
26538
|
-
exports.DEVICE_STATUS_METHOD =
|
|
27149
|
+
exports.DEVICE_SETTINGS_CONTRIBUTION_METHODS = require_capability_definition.DEVICE_SETTINGS_CONTRIBUTION_METHODS;
|
|
27150
|
+
exports.DEVICE_STATUS_METHOD = require_capability_definition.DEVICE_STATUS_METHOD;
|
|
26539
27151
|
exports.DataPlaneRegistry = DataPlaneRegistry;
|
|
26540
27152
|
exports.DeviceCaStore = require_builtins_local_auth_local_auth_addon.DeviceCaStore;
|
|
26541
27153
|
exports.DeviceCredentialManager = require_builtins_local_auth_local_auth_addon.DeviceCredentialManager;
|
|
@@ -26603,15 +27215,15 @@ exports.MAX_CAP_ACTIONS_PER_PEER = MAX_CAP_ACTIONS_PER_PEER;
|
|
|
26603
27215
|
exports.MAX_LEAF_VALIDITY_DAYS = require_hub_identity.MAX_LEAF_VALIDITY_DAYS;
|
|
26604
27216
|
exports.MEMBERSHIP_PATHS = require_builtins_system_config_system_config_addon.MEMBERSHIP_PATHS;
|
|
26605
27217
|
exports.MESH_ACTION_FORBIDDEN_TYPE = MESH_ACTION_FORBIDDEN_TYPE;
|
|
26606
|
-
exports.MESH_CA_FIELD = require_constants.MESH_CA_FIELD;
|
|
26607
|
-
exports.MESH_CA_KEY_REF = require_constants.MESH_CA_KEY_REF;
|
|
26608
|
-
exports.MESH_CA_SETTINGS_KEY = require_constants.MESH_CA_SETTINGS_KEY;
|
|
27218
|
+
exports.MESH_CA_FIELD = require_constants$1.MESH_CA_FIELD;
|
|
27219
|
+
exports.MESH_CA_KEY_REF = require_constants$1.MESH_CA_KEY_REF;
|
|
27220
|
+
exports.MESH_CA_SETTINGS_KEY = require_constants$1.MESH_CA_SETTINGS_KEY;
|
|
26609
27221
|
exports.MESH_NODE_CERTIFICATES_COLLECTION = require_builtins_system_config_system_config_addon.MESH_NODE_CERTIFICATES_COLLECTION;
|
|
26610
27222
|
exports.MESH_NODE_CERTIFICATES_COLUMNS = require_builtins_system_config_system_config_addon.MESH_NODE_CERTIFICATES_COLUMNS;
|
|
26611
27223
|
exports.MESH_NODE_UNAUTHENTICATED_TYPE = MESH_NODE_UNAUTHENTICATED_TYPE;
|
|
26612
27224
|
exports.MESH_QUEUE_TOP_N = MESH_QUEUE_TOP_N;
|
|
26613
27225
|
exports.MESH_TLS_PORT_HELLO_FIELD = require_builtins_system_config_system_config_addon.MESH_TLS_PORT_HELLO_FIELD;
|
|
26614
|
-
exports.METHOD_ACCESS_MAP =
|
|
27226
|
+
exports.METHOD_ACCESS_MAP = require_builtins_device_manager_device_manager_addon.METHOD_ACCESS_MAP;
|
|
26615
27227
|
exports.MembershipResponder = require_builtins_system_config_system_config_addon.MembershipResponder;
|
|
26616
27228
|
exports.MeshCaKeeper = require_builtins_system_config_system_config_addon.MeshCaKeeper;
|
|
26617
27229
|
exports.MeshCertificateRegistry = require_builtins_system_config_system_config_addon.MeshCertificateRegistry;
|
|
@@ -26658,9 +27270,9 @@ exports.RSS_BUDGET_REANNOUNCE_MIN_MS = RSS_BUDGET_REANNOUNCE_MIN_MS;
|
|
|
26658
27270
|
exports.RSS_BUDGET_RELEASE_RATIO = RSS_BUDGET_RELEASE_RATIO;
|
|
26659
27271
|
exports.RUNNER_HEAP_WATCH_INTERVAL_MS = RUNNER_HEAP_WATCH_INTERVAL_MS;
|
|
26660
27272
|
exports.RUNNER_RSS_BUDGET_ENV = RUNNER_RSS_BUDGET_ENV;
|
|
26661
|
-
exports.RUNTIME_DEFAULTS =
|
|
26662
|
-
exports.ReadinessRegistry =
|
|
26663
|
-
exports.ReadinessTimeoutError =
|
|
27273
|
+
exports.RUNTIME_DEFAULTS = require_constants.RUNTIME_DEFAULTS;
|
|
27274
|
+
exports.ReadinessRegistry = ReadinessRegistry;
|
|
27275
|
+
exports.ReadinessTimeoutError = ReadinessTimeoutError;
|
|
26664
27276
|
exports.RecordsEngine = require_wal_maintenance.RecordsEngine;
|
|
26665
27277
|
exports.RegistryReadError = RegistryReadError;
|
|
26666
27278
|
exports.ReplEngine = ReplEngine;
|
|
@@ -26712,7 +27324,7 @@ exports.__resetStateRefreshPolicyRegistryForTests = require_builtins_device_mana
|
|
|
26712
27324
|
exports.acceptAgentSans = require_hub_identity.acceptAgentSans;
|
|
26713
27325
|
exports.adaptBrokerToCluster = adaptBrokerToCluster;
|
|
26714
27326
|
exports.addonCommandActor = require_builtins_device_manager_device_manager_addon.addonCommandActor;
|
|
26715
|
-
exports.addonSettingsCapability =
|
|
27327
|
+
exports.addonSettingsCapability = require_addon_settings_cap.addonSettingsCapability;
|
|
26716
27328
|
exports.adoptModelRevisions = require_custom_action_registry.adoptModelRevisions;
|
|
26717
27329
|
exports.afterWorkerOnlineAnnounce = afterWorkerOnlineAnnounce;
|
|
26718
27330
|
exports.agentHttpsPaths = require_hub_identity.agentHttpsPaths;
|
|
@@ -26864,7 +27476,7 @@ Object.defineProperty(exports, "downloadBinary", {
|
|
|
26864
27476
|
exports.downloadFile = require_custom_action_registry.downloadFile;
|
|
26865
27477
|
exports.downloadModel = require_custom_action_registry.downloadModel;
|
|
26866
27478
|
exports.dropProcessPeer = require_builtins_system_config_system_config_addon.dropProcessPeer;
|
|
26867
|
-
exports.emitDownForOwnedCaps =
|
|
27479
|
+
exports.emitDownForOwnedCaps = emitDownForOwnedCaps;
|
|
26868
27480
|
exports.emitHeapDiagnosticReport = emitHeapDiagnosticReport;
|
|
26869
27481
|
exports.emitProcessNodeRegistered = require_builtins_system_config_system_config_addon.emitProcessNodeRegistered;
|
|
26870
27482
|
exports.encodeFrame = encodeFrame;
|
|
@@ -26892,7 +27504,7 @@ Object.defineProperty(exports, "ensurePython", {
|
|
|
26892
27504
|
});
|
|
26893
27505
|
exports.ensureTlsCert = require_hub_mdns_ciao.ensureTlsCert;
|
|
26894
27506
|
exports.evaluateExistingCert = require_hub_identity.evaluateExistingCert;
|
|
26895
|
-
exports.expandCapMethods =
|
|
27507
|
+
exports.expandCapMethods = require_capability_definition.expandCapMethods;
|
|
26896
27508
|
exports.exportMeshPrivateKeyPem = require_builtins_system_config_system_config_addon.exportMeshPrivateKeyPem;
|
|
26897
27509
|
exports.fetchJson = require_custom_action_registry.fetchJson;
|
|
26898
27510
|
exports.filterIsEmpty = require_log_read_filter.filterIsEmpty;
|
|
@@ -26989,8 +27601,8 @@ exports.isAddonDeploySource = isAddonDeploySource;
|
|
|
26989
27601
|
exports.isAllowedAgentDashboardReturnTo = require_builtins_system_config_system_config_addon.isAllowedAgentDashboardReturnTo;
|
|
26990
27602
|
exports.isAnnouncedHubId = require_hub_identity.isAnnouncedHubId;
|
|
26991
27603
|
exports.isArrayBufferCensusReport = isArrayBufferCensusReport;
|
|
26992
|
-
exports.isArrayOutputSchema =
|
|
26993
|
-
exports.isCollectionArrayMethod =
|
|
27604
|
+
exports.isArrayOutputSchema = require_rename_composition_block.isArrayOutputSchema;
|
|
27605
|
+
exports.isCollectionArrayMethod = require_rename_composition_block.isCollectionArrayMethod;
|
|
26994
27606
|
exports.isConstrainedCa = require_hub_identity.isConstrainedCa;
|
|
26995
27607
|
exports.isContainerBridgeAddress = require_hub_identity.isContainerBridgeAddress;
|
|
26996
27608
|
exports.isCredentialKeyName = require_log_redactor.isCredentialKeyName;
|
|
@@ -27081,7 +27693,7 @@ exports.readSocketQueues = readSocketQueues;
|
|
|
27081
27693
|
exports.readTlsAccessStatus = require_hub_mdns_ciao.readTlsAccessStatus;
|
|
27082
27694
|
exports.readTlsEnabled = require_hub_mdns_ciao.readTlsEnabled;
|
|
27083
27695
|
exports.readTlsMode = require_hub_mdns_ciao.readTlsMode;
|
|
27084
|
-
exports.readinessKey =
|
|
27696
|
+
exports.readinessKey = readinessKey;
|
|
27085
27697
|
exports.reclaimIntervalMs = reclaimIntervalMs;
|
|
27086
27698
|
exports.recordHeldInstall = recordHeldInstall;
|
|
27087
27699
|
exports.recordSocketFrame = recordSocketFrame;
|
|
@@ -27114,9 +27726,9 @@ exports.runObservedCommand = require_builtins_device_manager_device_manager_addo
|
|
|
27114
27726
|
exports.runWithCapCallContext = require_cap_call_scope.runWithCapCallContext;
|
|
27115
27727
|
exports.sampleSocketDirection = sampleSocketDirection;
|
|
27116
27728
|
exports.scheduleSelfRestart = scheduleSelfRestart;
|
|
27117
|
-
exports.scopeKey =
|
|
27118
|
-
exports.scopesAllowAddon =
|
|
27119
|
-
exports.scopesAllowDeviceCap =
|
|
27729
|
+
exports.scopeKey = scopeKey;
|
|
27730
|
+
exports.scopesAllowAddon = scopesAllowAddon;
|
|
27731
|
+
exports.scopesAllowDeviceCap = scopesAllowDeviceCap;
|
|
27120
27732
|
exports.selectAddonResidue = selectAddonResidue;
|
|
27121
27733
|
exports.selectReportedSpaces = selectReportedSpaces;
|
|
27122
27734
|
exports.serializeTypedArrays = serializeTypedArrays;
|