@camstack/server 1.2.928 → 1.2.930
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 +12 -0
- package/package.json +10 -10
- 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/actions-service.d.ts +18 -1
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +8670 -386
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +8294 -11
- package/system/dist/builtins/core-blocks/tcp-connect.d.ts +3 -0
- package/system/dist/builtins/core-notifier/core-notifier.addon.js +250 -21
- package/system/dist/builtins/core-notifier/core-notifier.addon.mjs +230 -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-BEUWn2s_.mjs +391 -0
- package/system/dist/composition-sources-acfR4hDq.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-BMeMCBrx.js +18733 -0
- package/system/dist/core-blocks.cap-BRPsLAij.mjs +18008 -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-BDh0LDhV.js +3428 -0
- package/system/dist/notification-rules.cap-DUmiMBQB.mjs +3357 -0
- package/system/dist/notification-targets-CRH-9Dy5.js +509 -0
- package/system/dist/notification-targets-DaNE-pIt.mjs +486 -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-BkMxoXpL.js +843 -0
- package/system/dist/prefix-walk-ifwg_ukx.mjs +790 -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-BJsL58Ih.js +34798 -0
- package/system/dist/rename-composition-block-OAtErZgq.mjs +33631 -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
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { c as method, l as optionalMethod } from "./capability-definition-C2rJdVeX.mjs";
|
|
2
|
+
import { t as NOT_A_DEVICE } from "./system-reasons-CYj4qwyS.mjs";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
//#region ../types/dist/esm/capabilities/log-destination.cap.mjs
|
|
5
|
+
var LogLevelSchema = /* @__PURE__ */ z.enum([
|
|
6
|
+
"debug",
|
|
7
|
+
"info",
|
|
8
|
+
"warn",
|
|
9
|
+
"error"
|
|
10
|
+
]);
|
|
11
|
+
var LogEntrySchema = /* @__PURE__ */ z.object({
|
|
12
|
+
timestamp: /* @__PURE__ */ z.date(),
|
|
13
|
+
level: LogLevelSchema,
|
|
14
|
+
scope: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()),
|
|
15
|
+
message: /* @__PURE__ */ z.string(),
|
|
16
|
+
meta: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.unknown()).optional(),
|
|
17
|
+
tags: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.string()).optional()
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* A history READ against one destination (D898).
|
|
21
|
+
*
|
|
22
|
+
* Every filter is applied by the PROVIDER, before the limit — a filter the
|
|
23
|
+
* browser applied after the limit is what made a rare device's lines
|
|
24
|
+
* unreachable behind a busy one's. `before` / `after` are cursors the provider
|
|
25
|
+
* minted (opaque to everyone else): a file position for the rotated files, a
|
|
26
|
+
* nanosecond timestamp for Loki.
|
|
27
|
+
*
|
|
28
|
+
* A read is BOUNDED by `budgetMs`: a filter that matches nothing on a 30-day
|
|
29
|
+
* store answers `done: false` with the cursor it reached and the bytes it
|
|
30
|
+
* scanned, and the caller decides whether to go on. That is what makes a long
|
|
31
|
+
* scan show progress and stop when asked — `cancelRead` ends the slice in
|
|
32
|
+
* flight, and not asking for the next slice ends the scan.
|
|
33
|
+
*/
|
|
34
|
+
var LogReadQuerySchema = /* @__PURE__ */ z.object({
|
|
35
|
+
/**
|
|
36
|
+
* Which destination INSTANCE answers (a destination addon may hold several records). Absent ⇒
|
|
37
|
+
* the provider's first readable one, so a caller written before instances existed is unchanged.
|
|
38
|
+
*/
|
|
39
|
+
instanceId: /* @__PURE__ */ z.string().min(1).max(200).optional(),
|
|
40
|
+
/** Correlates `cancelRead`. Caller-chosen, unique per in-flight read. */
|
|
41
|
+
requestId: /* @__PURE__ */ z.string().min(1).max(64).optional(),
|
|
42
|
+
/** The device the line is about (`tags.deviceId`, numeric). */
|
|
43
|
+
deviceId: /* @__PURE__ */ z.number().int().optional(),
|
|
44
|
+
/**
|
|
45
|
+
* The emitting addon — bare manifest id; `@<version>` / `::<sub>` suffixes
|
|
46
|
+
* match. Not `addonId`: a cap router reads that name as "which provider".
|
|
47
|
+
*/
|
|
48
|
+
fromAddonId: /* @__PURE__ */ z.string().min(1).max(200).optional(),
|
|
49
|
+
/**
|
|
50
|
+
* The emitting node: matches the agent that emitted the line, the node
|
|
51
|
+
* itself, or a worker under it (`<agent>/<runner>`) — the `agentId`
|
|
52
|
+
* semantics of `matchesLogTags`. Not `nodeId`: a cap router reads that
|
|
53
|
+
* name as "which node's provider".
|
|
54
|
+
*/
|
|
55
|
+
fromNodeId: /* @__PURE__ */ z.string().min(1).max(200).optional(),
|
|
56
|
+
/** Any other tag, exact match (AND). */
|
|
57
|
+
tags: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.union([/* @__PURE__ */ z.string(), /* @__PURE__ */ z.number()])).optional(),
|
|
58
|
+
/** Severity FLOOR: this level and above. */
|
|
59
|
+
level: /* @__PURE__ */ LogLevelSchema.optional(),
|
|
60
|
+
/** Case-insensitive substring over message, scope, tag values and meta values. */
|
|
61
|
+
text: /* @__PURE__ */ z.string().min(1).max(200).optional(),
|
|
62
|
+
/** Epoch ms, inclusive. */
|
|
63
|
+
since: /* @__PURE__ */ z.number().optional(),
|
|
64
|
+
/** Epoch ms, inclusive. */
|
|
65
|
+
until: /* @__PURE__ */ z.number().optional(),
|
|
66
|
+
/** Older than this cursor (exclusive). Absent with `after` absent ⇒ from the newest. */
|
|
67
|
+
before: /* @__PURE__ */ z.string().min(1).max(1024).optional(),
|
|
68
|
+
/** Newer than this cursor (exclusive). */
|
|
69
|
+
after: /* @__PURE__ */ z.string().min(1).max(1024).optional(),
|
|
70
|
+
limit: /* @__PURE__ */ z.number().int().min(1).max(1e3).optional(),
|
|
71
|
+
/** Wall-clock bound of this slice. The provider caps it. */
|
|
72
|
+
budgetMs: /* @__PURE__ */ z.number().int().min(50).max(1e4).optional()
|
|
73
|
+
});
|
|
74
|
+
var LogReadEntrySchema = /* @__PURE__ */ z.object({
|
|
75
|
+
/** `<bootId>.<seq>` minted by the emitting LogManager — the dedupe key. */
|
|
76
|
+
id: /* @__PURE__ */ z.string().optional(),
|
|
77
|
+
/** Epoch ms. */
|
|
78
|
+
timestamp: /* @__PURE__ */ z.number(),
|
|
79
|
+
level: LogLevelSchema,
|
|
80
|
+
scope: /* @__PURE__ */ z.string().optional(),
|
|
81
|
+
message: /* @__PURE__ */ z.string(),
|
|
82
|
+
tags: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.union([/* @__PURE__ */ z.string(), /* @__PURE__ */ z.number()])).optional(),
|
|
83
|
+
meta: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.unknown()).optional()
|
|
84
|
+
});
|
|
85
|
+
var LogReadResultSchema = /* @__PURE__ */ z.object({
|
|
86
|
+
/** Newest first. */
|
|
87
|
+
entries: /* @__PURE__ */ z.array(LogReadEntrySchema),
|
|
88
|
+
/** Pass as `before` for the next older page; null when nothing older exists. */
|
|
89
|
+
nextBefore: /* @__PURE__ */ z.string().nullable(),
|
|
90
|
+
/** Pass as `after` to read what arrived since; null when unknown. */
|
|
91
|
+
nextAfter: /* @__PURE__ */ z.string().nullable(),
|
|
92
|
+
/** Bytes this slice read (files) or received (remote). Progress, not a promise. */
|
|
93
|
+
scannedBytes: /* @__PURE__ */ z.number().int().nonnegative(),
|
|
94
|
+
/**
|
|
95
|
+
* True when the scan in this direction reached the end of the store.
|
|
96
|
+
* False with fewer than `limit` entries means the budget ran out first —
|
|
97
|
+
* call again with `nextBefore` to go on.
|
|
98
|
+
*/
|
|
99
|
+
done: /* @__PURE__ */ z.boolean(),
|
|
100
|
+
/** True when `cancelRead` ended this slice early. */
|
|
101
|
+
cancelled: /* @__PURE__ */ z.boolean().optional()
|
|
102
|
+
});
|
|
103
|
+
/** Names one destination instance; absent ⇒ the provider's first readable one. */
|
|
104
|
+
var LogInstanceSelectorSchema = /* @__PURE__ */ z.object({ instanceId: /* @__PURE__ */ z.string().min(1).max(200).optional() });
|
|
105
|
+
var LogReadCapabilitiesSchema = /* @__PURE__ */ z.object({
|
|
106
|
+
/** False ⇒ this destination only ships lines (console, forwarder, an unconfigured Loki). */
|
|
107
|
+
readable: /* @__PURE__ */ z.boolean(),
|
|
108
|
+
/** Why not, when `readable` is false — rendered next to the source. */
|
|
109
|
+
reason: /* @__PURE__ */ z.string().nullable(),
|
|
110
|
+
/** Filters the provider applies itself. A false one is applied by nobody. */
|
|
111
|
+
filters: /* @__PURE__ */ z.object({
|
|
112
|
+
deviceId: /* @__PURE__ */ z.boolean(),
|
|
113
|
+
addonId: /* @__PURE__ */ z.boolean(),
|
|
114
|
+
nodeId: /* @__PURE__ */ z.boolean(),
|
|
115
|
+
tags: /* @__PURE__ */ z.boolean(),
|
|
116
|
+
level: /* @__PURE__ */ z.boolean(),
|
|
117
|
+
text: /* @__PURE__ */ z.boolean(),
|
|
118
|
+
timeRange: /* @__PURE__ */ z.boolean()
|
|
119
|
+
}),
|
|
120
|
+
/** How far back the store reaches, when the provider knows (days). */
|
|
121
|
+
retentionDays: /* @__PURE__ */ z.number().nullable()
|
|
122
|
+
});
|
|
123
|
+
var logDestinationCapability = {
|
|
124
|
+
name: "log-destination",
|
|
125
|
+
scope: "system",
|
|
126
|
+
mode: "collection",
|
|
127
|
+
internal: true,
|
|
128
|
+
methods: {
|
|
129
|
+
write: /* @__PURE__ */ method(LogEntrySchema, /* @__PURE__ */ z.void(), { kind: "mutation" }),
|
|
130
|
+
/** Absent ⇒ the destination cannot read back (same as `readable: false`). */
|
|
131
|
+
describeRead: /* @__PURE__ */ optionalMethod(LogInstanceSelectorSchema, LogReadCapabilitiesSchema, { auth: "admin" }),
|
|
132
|
+
read: /* @__PURE__ */ optionalMethod(LogReadQuerySchema, LogReadResultSchema, { auth: "admin" }),
|
|
133
|
+
cancelRead: /* @__PURE__ */ optionalMethod(/* @__PURE__ */ z.object({ requestId: /* @__PURE__ */ z.string().min(1).max(64) }), /* @__PURE__ */ z.object({ cancelled: /* @__PURE__ */ z.boolean() }), {
|
|
134
|
+
kind: "mutation",
|
|
135
|
+
auth: "admin"
|
|
136
|
+
})
|
|
137
|
+
},
|
|
138
|
+
/** BIG PLAN 2: declarative mount hint — read by `@camstack/server/system` `buildCapRouters`. */
|
|
139
|
+
mount: { kind: "skip" },
|
|
140
|
+
vocabulary: { notOperatorFacing: NOT_A_DEVICE.INTERNAL }
|
|
141
|
+
};
|
|
142
|
+
//#endregion
|
|
143
|
+
export { logDestinationCapability as t };
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
const require_capability_definition = require("./capability-definition-HCmTem8c.js");
|
|
2
|
+
const require_system_reasons = require("./system-reasons-Be_k1W8g.js");
|
|
3
|
+
let zod = require("zod");
|
|
4
|
+
//#region ../types/dist/esm/capabilities/log-destination.cap.mjs
|
|
5
|
+
var LogLevelSchema = /* @__PURE__ */ zod.z.enum([
|
|
6
|
+
"debug",
|
|
7
|
+
"info",
|
|
8
|
+
"warn",
|
|
9
|
+
"error"
|
|
10
|
+
]);
|
|
11
|
+
var LogEntrySchema = /* @__PURE__ */ zod.z.object({
|
|
12
|
+
timestamp: /* @__PURE__ */ zod.z.date(),
|
|
13
|
+
level: LogLevelSchema,
|
|
14
|
+
scope: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()),
|
|
15
|
+
message: /* @__PURE__ */ zod.z.string(),
|
|
16
|
+
meta: /* @__PURE__ */ zod.z.record(/* @__PURE__ */ zod.z.string(), /* @__PURE__ */ zod.z.unknown()).optional(),
|
|
17
|
+
tags: /* @__PURE__ */ zod.z.record(/* @__PURE__ */ zod.z.string(), /* @__PURE__ */ zod.z.string()).optional()
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* A history READ against one destination (D898).
|
|
21
|
+
*
|
|
22
|
+
* Every filter is applied by the PROVIDER, before the limit — a filter the
|
|
23
|
+
* browser applied after the limit is what made a rare device's lines
|
|
24
|
+
* unreachable behind a busy one's. `before` / `after` are cursors the provider
|
|
25
|
+
* minted (opaque to everyone else): a file position for the rotated files, a
|
|
26
|
+
* nanosecond timestamp for Loki.
|
|
27
|
+
*
|
|
28
|
+
* A read is BOUNDED by `budgetMs`: a filter that matches nothing on a 30-day
|
|
29
|
+
* store answers `done: false` with the cursor it reached and the bytes it
|
|
30
|
+
* scanned, and the caller decides whether to go on. That is what makes a long
|
|
31
|
+
* scan show progress and stop when asked — `cancelRead` ends the slice in
|
|
32
|
+
* flight, and not asking for the next slice ends the scan.
|
|
33
|
+
*/
|
|
34
|
+
var LogReadQuerySchema = /* @__PURE__ */ zod.z.object({
|
|
35
|
+
/**
|
|
36
|
+
* Which destination INSTANCE answers (a destination addon may hold several records). Absent ⇒
|
|
37
|
+
* the provider's first readable one, so a caller written before instances existed is unchanged.
|
|
38
|
+
*/
|
|
39
|
+
instanceId: /* @__PURE__ */ zod.z.string().min(1).max(200).optional(),
|
|
40
|
+
/** Correlates `cancelRead`. Caller-chosen, unique per in-flight read. */
|
|
41
|
+
requestId: /* @__PURE__ */ zod.z.string().min(1).max(64).optional(),
|
|
42
|
+
/** The device the line is about (`tags.deviceId`, numeric). */
|
|
43
|
+
deviceId: /* @__PURE__ */ zod.z.number().int().optional(),
|
|
44
|
+
/**
|
|
45
|
+
* The emitting addon — bare manifest id; `@<version>` / `::<sub>` suffixes
|
|
46
|
+
* match. Not `addonId`: a cap router reads that name as "which provider".
|
|
47
|
+
*/
|
|
48
|
+
fromAddonId: /* @__PURE__ */ zod.z.string().min(1).max(200).optional(),
|
|
49
|
+
/**
|
|
50
|
+
* The emitting node: matches the agent that emitted the line, the node
|
|
51
|
+
* itself, or a worker under it (`<agent>/<runner>`) — the `agentId`
|
|
52
|
+
* semantics of `matchesLogTags`. Not `nodeId`: a cap router reads that
|
|
53
|
+
* name as "which node's provider".
|
|
54
|
+
*/
|
|
55
|
+
fromNodeId: /* @__PURE__ */ zod.z.string().min(1).max(200).optional(),
|
|
56
|
+
/** Any other tag, exact match (AND). */
|
|
57
|
+
tags: /* @__PURE__ */ zod.z.record(/* @__PURE__ */ zod.z.string(), /* @__PURE__ */ zod.z.union([/* @__PURE__ */ zod.z.string(), /* @__PURE__ */ zod.z.number()])).optional(),
|
|
58
|
+
/** Severity FLOOR: this level and above. */
|
|
59
|
+
level: /* @__PURE__ */ LogLevelSchema.optional(),
|
|
60
|
+
/** Case-insensitive substring over message, scope, tag values and meta values. */
|
|
61
|
+
text: /* @__PURE__ */ zod.z.string().min(1).max(200).optional(),
|
|
62
|
+
/** Epoch ms, inclusive. */
|
|
63
|
+
since: /* @__PURE__ */ zod.z.number().optional(),
|
|
64
|
+
/** Epoch ms, inclusive. */
|
|
65
|
+
until: /* @__PURE__ */ zod.z.number().optional(),
|
|
66
|
+
/** Older than this cursor (exclusive). Absent with `after` absent ⇒ from the newest. */
|
|
67
|
+
before: /* @__PURE__ */ zod.z.string().min(1).max(1024).optional(),
|
|
68
|
+
/** Newer than this cursor (exclusive). */
|
|
69
|
+
after: /* @__PURE__ */ zod.z.string().min(1).max(1024).optional(),
|
|
70
|
+
limit: /* @__PURE__ */ zod.z.number().int().min(1).max(1e3).optional(),
|
|
71
|
+
/** Wall-clock bound of this slice. The provider caps it. */
|
|
72
|
+
budgetMs: /* @__PURE__ */ zod.z.number().int().min(50).max(1e4).optional()
|
|
73
|
+
});
|
|
74
|
+
var LogReadEntrySchema = /* @__PURE__ */ zod.z.object({
|
|
75
|
+
/** `<bootId>.<seq>` minted by the emitting LogManager — the dedupe key. */
|
|
76
|
+
id: /* @__PURE__ */ zod.z.string().optional(),
|
|
77
|
+
/** Epoch ms. */
|
|
78
|
+
timestamp: /* @__PURE__ */ zod.z.number(),
|
|
79
|
+
level: LogLevelSchema,
|
|
80
|
+
scope: /* @__PURE__ */ zod.z.string().optional(),
|
|
81
|
+
message: /* @__PURE__ */ zod.z.string(),
|
|
82
|
+
tags: /* @__PURE__ */ zod.z.record(/* @__PURE__ */ zod.z.string(), /* @__PURE__ */ zod.z.union([/* @__PURE__ */ zod.z.string(), /* @__PURE__ */ zod.z.number()])).optional(),
|
|
83
|
+
meta: /* @__PURE__ */ zod.z.record(/* @__PURE__ */ zod.z.string(), /* @__PURE__ */ zod.z.unknown()).optional()
|
|
84
|
+
});
|
|
85
|
+
var LogReadResultSchema = /* @__PURE__ */ zod.z.object({
|
|
86
|
+
/** Newest first. */
|
|
87
|
+
entries: /* @__PURE__ */ zod.z.array(LogReadEntrySchema),
|
|
88
|
+
/** Pass as `before` for the next older page; null when nothing older exists. */
|
|
89
|
+
nextBefore: /* @__PURE__ */ zod.z.string().nullable(),
|
|
90
|
+
/** Pass as `after` to read what arrived since; null when unknown. */
|
|
91
|
+
nextAfter: /* @__PURE__ */ zod.z.string().nullable(),
|
|
92
|
+
/** Bytes this slice read (files) or received (remote). Progress, not a promise. */
|
|
93
|
+
scannedBytes: /* @__PURE__ */ zod.z.number().int().nonnegative(),
|
|
94
|
+
/**
|
|
95
|
+
* True when the scan in this direction reached the end of the store.
|
|
96
|
+
* False with fewer than `limit` entries means the budget ran out first —
|
|
97
|
+
* call again with `nextBefore` to go on.
|
|
98
|
+
*/
|
|
99
|
+
done: /* @__PURE__ */ zod.z.boolean(),
|
|
100
|
+
/** True when `cancelRead` ended this slice early. */
|
|
101
|
+
cancelled: /* @__PURE__ */ zod.z.boolean().optional()
|
|
102
|
+
});
|
|
103
|
+
/** Names one destination instance; absent ⇒ the provider's first readable one. */
|
|
104
|
+
var LogInstanceSelectorSchema = /* @__PURE__ */ zod.z.object({ instanceId: /* @__PURE__ */ zod.z.string().min(1).max(200).optional() });
|
|
105
|
+
var LogReadCapabilitiesSchema = /* @__PURE__ */ zod.z.object({
|
|
106
|
+
/** False ⇒ this destination only ships lines (console, forwarder, an unconfigured Loki). */
|
|
107
|
+
readable: /* @__PURE__ */ zod.z.boolean(),
|
|
108
|
+
/** Why not, when `readable` is false — rendered next to the source. */
|
|
109
|
+
reason: /* @__PURE__ */ zod.z.string().nullable(),
|
|
110
|
+
/** Filters the provider applies itself. A false one is applied by nobody. */
|
|
111
|
+
filters: /* @__PURE__ */ zod.z.object({
|
|
112
|
+
deviceId: /* @__PURE__ */ zod.z.boolean(),
|
|
113
|
+
addonId: /* @__PURE__ */ zod.z.boolean(),
|
|
114
|
+
nodeId: /* @__PURE__ */ zod.z.boolean(),
|
|
115
|
+
tags: /* @__PURE__ */ zod.z.boolean(),
|
|
116
|
+
level: /* @__PURE__ */ zod.z.boolean(),
|
|
117
|
+
text: /* @__PURE__ */ zod.z.boolean(),
|
|
118
|
+
timeRange: /* @__PURE__ */ zod.z.boolean()
|
|
119
|
+
}),
|
|
120
|
+
/** How far back the store reaches, when the provider knows (days). */
|
|
121
|
+
retentionDays: /* @__PURE__ */ zod.z.number().nullable()
|
|
122
|
+
});
|
|
123
|
+
var logDestinationCapability = {
|
|
124
|
+
name: "log-destination",
|
|
125
|
+
scope: "system",
|
|
126
|
+
mode: "collection",
|
|
127
|
+
internal: true,
|
|
128
|
+
methods: {
|
|
129
|
+
write: /* @__PURE__ */ require_capability_definition.method(LogEntrySchema, /* @__PURE__ */ zod.z.void(), { kind: "mutation" }),
|
|
130
|
+
/** Absent ⇒ the destination cannot read back (same as `readable: false`). */
|
|
131
|
+
describeRead: /* @__PURE__ */ require_capability_definition.optionalMethod(LogInstanceSelectorSchema, LogReadCapabilitiesSchema, { auth: "admin" }),
|
|
132
|
+
read: /* @__PURE__ */ require_capability_definition.optionalMethod(LogReadQuerySchema, LogReadResultSchema, { auth: "admin" }),
|
|
133
|
+
cancelRead: /* @__PURE__ */ require_capability_definition.optionalMethod(/* @__PURE__ */ zod.z.object({ requestId: /* @__PURE__ */ zod.z.string().min(1).max(64) }), /* @__PURE__ */ zod.z.object({ cancelled: /* @__PURE__ */ zod.z.boolean() }), {
|
|
134
|
+
kind: "mutation",
|
|
135
|
+
auth: "admin"
|
|
136
|
+
})
|
|
137
|
+
},
|
|
138
|
+
/** BIG PLAN 2: declarative mount hint — read by `@camstack/server/system` `buildCapRouters`. */
|
|
139
|
+
mount: { kind: "skip" },
|
|
140
|
+
vocabulary: { notOperatorFacing: require_system_reasons.NOT_A_DEVICE.INTERNAL }
|
|
141
|
+
};
|
|
142
|
+
//#endregion
|
|
143
|
+
Object.defineProperty(exports, "logDestinationCapability", {
|
|
144
|
+
enumerable: true,
|
|
145
|
+
get: function() {
|
|
146
|
+
return logDestinationCapability;
|
|
147
|
+
}
|
|
148
|
+
});
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
const require_capability_definition = require("./capability-definition-HCmTem8c.js");
|
|
2
|
+
const require_quantity = require("./quantity-lY1KiTSZ.js");
|
|
3
|
+
const require_device_type = require("./device-type-CbQsnFdC.js");
|
|
4
|
+
const require_l10n = require("./l10n-CGMvp7NF.js");
|
|
5
|
+
let zod = require("zod");
|
|
6
|
+
//#region ../types/dist/esm/capabilities/low-power-sleep.cap.mjs
|
|
7
|
+
/**
|
|
8
|
+
* low-power-sleep — a device that goes into low-power sleep and must be WOKEN
|
|
9
|
+
* before it streams (#459, Q2). A battery camera (Reolink Argus, a robot's
|
|
10
|
+
* on-board camera) is one; a battery SENSOR is not: it reports charge on the
|
|
11
|
+
* `battery` cap and never sleeps. The two meanings used to share
|
|
12
|
+
* `DeviceFeature.BatteryOperated`; this cap is the one that answers "sleeps",
|
|
13
|
+
* and `DeviceFeature.Sleeps` is derived from it being bound with
|
|
14
|
+
* `wakeUp` implemented.
|
|
15
|
+
*
|
|
16
|
+
* The state is the sleep inputs (`deriveBatteryPresence`): whether the device
|
|
17
|
+
* is asleep, and the last time it PROVED it was reachable. Read from this slice
|
|
18
|
+
* by the stream broker (`readBatterySleepFacts`), the recorder
|
|
19
|
+
* (`recordingWakeDeps`) and the snapshot builtin. The broker's per-device
|
|
20
|
+
* mirror is still also fed by `BatteryOnStatusChanged` events.
|
|
21
|
+
*/
|
|
22
|
+
var LowPowerSleepStatusSchema = /* @__PURE__ */ zod.z.object({
|
|
23
|
+
/**
|
|
24
|
+
* True while the firmware is in low-power mode. A provider MUST avoid polling
|
|
25
|
+
* during sleep — a read wakes the device and drains charge.
|
|
26
|
+
*/
|
|
27
|
+
sleeping: /* @__PURE__ */ zod.z.boolean().meta({ label: "Sleeping" }),
|
|
28
|
+
/**
|
|
29
|
+
* Ms epoch of the last time the device proved it was reachable, from
|
|
30
|
+
* PASSIVE signals only (a completed round-trip, an observed wake, a push).
|
|
31
|
+
* Absent = never since this slice was born. The only input that separates
|
|
32
|
+
* "asleep" from "gone".
|
|
33
|
+
*/
|
|
34
|
+
lastContactAt: /* @__PURE__ */ zod.z.number().optional(),
|
|
35
|
+
/** Ms epoch of the last observation. */
|
|
36
|
+
lastUpdated: /* @__PURE__ */ zod.z.number().meta(/* @__PURE__ */ require_quantity.readingMeta("none"))
|
|
37
|
+
});
|
|
38
|
+
var lowPowerSleepCapability = {
|
|
39
|
+
name: "low-power-sleep",
|
|
40
|
+
scope: "device",
|
|
41
|
+
deviceNative: true,
|
|
42
|
+
mode: "singleton",
|
|
43
|
+
deviceTypes: [require_device_type.DeviceType.Camera],
|
|
44
|
+
methods: {
|
|
45
|
+
/**
|
|
46
|
+
* Explicitly wake the device from low-power sleep ahead of a streaming
|
|
47
|
+
* session start. Consumers that initiate a stream against a sleeping
|
|
48
|
+
* camera (wake-on-play, the recorder, HomeKit, Alexa, snapshot wrappers)
|
|
49
|
+
* call this with a short timeout before establishing the media pipeline —
|
|
50
|
+
* the broker's own passive wake-on-dial works but adds 5–7 seconds to
|
|
51
|
+
* first-frame. Pre-waking compresses that gap.
|
|
52
|
+
*
|
|
53
|
+
* Returns `awoke: true` when the firmware acknowledged the wake before
|
|
54
|
+
* `timeoutMs`, `awoke: false` when it timed out; the caller should still
|
|
55
|
+
* attempt the stream — the passive broker wake remains as fallback.
|
|
56
|
+
*/
|
|
57
|
+
wakeUp: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
|
|
58
|
+
deviceId: /* @__PURE__ */ zod.z.number(),
|
|
59
|
+
/** Bound on the wait. Sensible range 3000–10000ms. */
|
|
60
|
+
timeoutMs: /* @__PURE__ */ zod.z.number().int().min(500).max(3e4).default(8e3)
|
|
61
|
+
}), /* @__PURE__ */ zod.z.object({
|
|
62
|
+
awoke: /* @__PURE__ */ zod.z.boolean(),
|
|
63
|
+
durationMs: /* @__PURE__ */ zod.z.number()
|
|
64
|
+
}), {
|
|
65
|
+
kind: "mutation",
|
|
66
|
+
notOperatorFacing: "a stream consumer wakes a sleeping camera to watch it; an automation that wants footage asks for the footage"
|
|
67
|
+
}) },
|
|
68
|
+
status: {
|
|
69
|
+
schema: LowPowerSleepStatusSchema,
|
|
70
|
+
kind: "push",
|
|
71
|
+
empty: {
|
|
72
|
+
sleeping: false,
|
|
73
|
+
lastUpdated: 0
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
runtimeState: LowPowerSleepStatusSchema,
|
|
77
|
+
/**
|
|
78
|
+
* Runtime-state durability: **restored** — a sleeping camera may not report
|
|
79
|
+
* for hours; the restored sleep inputs are the only thing the sleep gate and
|
|
80
|
+
* the presence derivation have (the same argument as `battery`).
|
|
81
|
+
*/
|
|
82
|
+
durability: "restored",
|
|
83
|
+
/** History (D850): none — battery never recorded a sleep series either. */
|
|
84
|
+
history: "none",
|
|
85
|
+
volatileStateFields: ["lastUpdated"],
|
|
86
|
+
vocabulary: {
|
|
87
|
+
noun: /* @__PURE__ */ require_l10n.t("Low-power sleep", "Sospensione a basso consumo"),
|
|
88
|
+
order: 5245
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
//#endregion
|
|
92
|
+
Object.defineProperty(exports, "LowPowerSleepStatusSchema", {
|
|
93
|
+
enumerable: true,
|
|
94
|
+
get: function() {
|
|
95
|
+
return LowPowerSleepStatusSchema;
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
Object.defineProperty(exports, "lowPowerSleepCapability", {
|
|
99
|
+
enumerable: true,
|
|
100
|
+
get: function() {
|
|
101
|
+
return lowPowerSleepCapability;
|
|
102
|
+
}
|
|
103
|
+
});
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { c as method } from "./capability-definition-C2rJdVeX.mjs";
|
|
2
|
+
import { a as readingMeta } from "./quantity-D3g5SxsZ.mjs";
|
|
3
|
+
import { r as DeviceType } from "./device-type-DgEvK3ch.mjs";
|
|
4
|
+
import { t } from "./l10n-Bu6aUvSY.mjs";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
//#region ../types/dist/esm/capabilities/low-power-sleep.cap.mjs
|
|
7
|
+
/**
|
|
8
|
+
* low-power-sleep — a device that goes into low-power sleep and must be WOKEN
|
|
9
|
+
* before it streams (#459, Q2). A battery camera (Reolink Argus, a robot's
|
|
10
|
+
* on-board camera) is one; a battery SENSOR is not: it reports charge on the
|
|
11
|
+
* `battery` cap and never sleeps. The two meanings used to share
|
|
12
|
+
* `DeviceFeature.BatteryOperated`; this cap is the one that answers "sleeps",
|
|
13
|
+
* and `DeviceFeature.Sleeps` is derived from it being bound with
|
|
14
|
+
* `wakeUp` implemented.
|
|
15
|
+
*
|
|
16
|
+
* The state is the sleep inputs (`deriveBatteryPresence`): whether the device
|
|
17
|
+
* is asleep, and the last time it PROVED it was reachable. Read from this slice
|
|
18
|
+
* by the stream broker (`readBatterySleepFacts`), the recorder
|
|
19
|
+
* (`recordingWakeDeps`) and the snapshot builtin. The broker's per-device
|
|
20
|
+
* mirror is still also fed by `BatteryOnStatusChanged` events.
|
|
21
|
+
*/
|
|
22
|
+
var LowPowerSleepStatusSchema = /* @__PURE__ */ z.object({
|
|
23
|
+
/**
|
|
24
|
+
* True while the firmware is in low-power mode. A provider MUST avoid polling
|
|
25
|
+
* during sleep — a read wakes the device and drains charge.
|
|
26
|
+
*/
|
|
27
|
+
sleeping: /* @__PURE__ */ z.boolean().meta({ label: "Sleeping" }),
|
|
28
|
+
/**
|
|
29
|
+
* Ms epoch of the last time the device proved it was reachable, from
|
|
30
|
+
* PASSIVE signals only (a completed round-trip, an observed wake, a push).
|
|
31
|
+
* Absent = never since this slice was born. The only input that separates
|
|
32
|
+
* "asleep" from "gone".
|
|
33
|
+
*/
|
|
34
|
+
lastContactAt: /* @__PURE__ */ z.number().optional(),
|
|
35
|
+
/** Ms epoch of the last observation. */
|
|
36
|
+
lastUpdated: /* @__PURE__ */ z.number().meta(/* @__PURE__ */ readingMeta("none"))
|
|
37
|
+
});
|
|
38
|
+
var lowPowerSleepCapability = {
|
|
39
|
+
name: "low-power-sleep",
|
|
40
|
+
scope: "device",
|
|
41
|
+
deviceNative: true,
|
|
42
|
+
mode: "singleton",
|
|
43
|
+
deviceTypes: [DeviceType.Camera],
|
|
44
|
+
methods: {
|
|
45
|
+
/**
|
|
46
|
+
* Explicitly wake the device from low-power sleep ahead of a streaming
|
|
47
|
+
* session start. Consumers that initiate a stream against a sleeping
|
|
48
|
+
* camera (wake-on-play, the recorder, HomeKit, Alexa, snapshot wrappers)
|
|
49
|
+
* call this with a short timeout before establishing the media pipeline —
|
|
50
|
+
* the broker's own passive wake-on-dial works but adds 5–7 seconds to
|
|
51
|
+
* first-frame. Pre-waking compresses that gap.
|
|
52
|
+
*
|
|
53
|
+
* Returns `awoke: true` when the firmware acknowledged the wake before
|
|
54
|
+
* `timeoutMs`, `awoke: false` when it timed out; the caller should still
|
|
55
|
+
* attempt the stream — the passive broker wake remains as fallback.
|
|
56
|
+
*/
|
|
57
|
+
wakeUp: /* @__PURE__ */ method(/* @__PURE__ */ z.object({
|
|
58
|
+
deviceId: /* @__PURE__ */ z.number(),
|
|
59
|
+
/** Bound on the wait. Sensible range 3000–10000ms. */
|
|
60
|
+
timeoutMs: /* @__PURE__ */ z.number().int().min(500).max(3e4).default(8e3)
|
|
61
|
+
}), /* @__PURE__ */ z.object({
|
|
62
|
+
awoke: /* @__PURE__ */ z.boolean(),
|
|
63
|
+
durationMs: /* @__PURE__ */ z.number()
|
|
64
|
+
}), {
|
|
65
|
+
kind: "mutation",
|
|
66
|
+
notOperatorFacing: "a stream consumer wakes a sleeping camera to watch it; an automation that wants footage asks for the footage"
|
|
67
|
+
}) },
|
|
68
|
+
status: {
|
|
69
|
+
schema: LowPowerSleepStatusSchema,
|
|
70
|
+
kind: "push",
|
|
71
|
+
empty: {
|
|
72
|
+
sleeping: false,
|
|
73
|
+
lastUpdated: 0
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
runtimeState: LowPowerSleepStatusSchema,
|
|
77
|
+
/**
|
|
78
|
+
* Runtime-state durability: **restored** — a sleeping camera may not report
|
|
79
|
+
* for hours; the restored sleep inputs are the only thing the sleep gate and
|
|
80
|
+
* the presence derivation have (the same argument as `battery`).
|
|
81
|
+
*/
|
|
82
|
+
durability: "restored",
|
|
83
|
+
/** History (D850): none — battery never recorded a sleep series either. */
|
|
84
|
+
history: "none",
|
|
85
|
+
volatileStateFields: ["lastUpdated"],
|
|
86
|
+
vocabulary: {
|
|
87
|
+
noun: /* @__PURE__ */ t("Low-power sleep", "Sospensione a basso consumo"),
|
|
88
|
+
order: 5245
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
//#endregion
|
|
92
|
+
export { lowPowerSleepCapability as n, LowPowerSleepStatusSchema as t };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { a as readingMeta } from "./quantity-D3g5SxsZ.mjs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region ../types/dist/esm/capabilities/mask-shape.mjs
|
|
4
|
+
/**
|
|
5
|
+
* Shared geometry vocabulary for on-frame shape caps — privacy-mask,
|
|
6
|
+
* motion-zones, and the detection zones/lines editor all speak this one
|
|
7
|
+
* language so a single drawing-plane editor and the providers stay
|
|
8
|
+
* decoupled from each cap's storage.
|
|
9
|
+
*
|
|
10
|
+
* All coordinates are normalized 0..1 of the camera frame (top-left
|
|
11
|
+
* origin). Each cap composes the SUBSET of shape kinds it supports and
|
|
12
|
+
* advertises it via `supportedShapes` in its `getOptions`.
|
|
13
|
+
*/
|
|
14
|
+
/** A normalized 0..1 point (top-left origin). */
|
|
15
|
+
var MaskPointSchema = /* @__PURE__ */ z.object({
|
|
16
|
+
x: /* @__PURE__ */ z.number(),
|
|
17
|
+
y: /* @__PURE__ */ z.number()
|
|
18
|
+
});
|
|
19
|
+
/** Axis-aligned rectangle (normalized 0..1). */
|
|
20
|
+
var MaskRectShapeSchema = /* @__PURE__ */ z.object({
|
|
21
|
+
kind: /* @__PURE__ */ z.literal("rect"),
|
|
22
|
+
x: /* @__PURE__ */ z.number(),
|
|
23
|
+
y: /* @__PURE__ */ z.number(),
|
|
24
|
+
width: /* @__PURE__ */ z.number(),
|
|
25
|
+
height: /* @__PURE__ */ z.number()
|
|
26
|
+
});
|
|
27
|
+
/** Free polygon — an ordered list of normalized vertices (≥3). */
|
|
28
|
+
var MaskPolygonShapeSchema = /* @__PURE__ */ z.object({
|
|
29
|
+
kind: /* @__PURE__ */ z.literal("polygon"),
|
|
30
|
+
points: /* @__PURE__ */ z.array(MaskPointSchema)
|
|
31
|
+
});
|
|
32
|
+
/** Boolean cell grid — row-major, length === gridWidth*gridHeight. */
|
|
33
|
+
var MaskGridShapeSchema = /* @__PURE__ */ z.object({
|
|
34
|
+
kind: /* @__PURE__ */ z.literal("grid"),
|
|
35
|
+
gridWidth: /* @__PURE__ */ z.number().meta(/* @__PURE__ */ readingMeta("none")),
|
|
36
|
+
gridHeight: /* @__PURE__ */ z.number().meta(/* @__PURE__ */ readingMeta("none")),
|
|
37
|
+
cells: /* @__PURE__ */ z.array(/* @__PURE__ */ z.boolean())
|
|
38
|
+
});
|
|
39
|
+
/** Every shape-kind discriminant, for `supportedShapes` advertisement. */
|
|
40
|
+
var MaskShapeKindSchema = /* @__PURE__ */ z.enum([
|
|
41
|
+
"rect",
|
|
42
|
+
"polygon",
|
|
43
|
+
"grid",
|
|
44
|
+
"line"
|
|
45
|
+
]);
|
|
46
|
+
/** Polygon vertex bounds when a cap supports 'polygon' (e.g. Hikvision {min:4,max:4}). */
|
|
47
|
+
var MaskPolygonVerticesSchema = /* @__PURE__ */ z.object({
|
|
48
|
+
min: /* @__PURE__ */ z.number(),
|
|
49
|
+
max: /* @__PURE__ */ z.number()
|
|
50
|
+
});
|
|
51
|
+
/** Grid dimensions when a cap supports 'grid'. */
|
|
52
|
+
var MaskGridDimsSchema = /* @__PURE__ */ z.object({
|
|
53
|
+
width: /* @__PURE__ */ z.number(),
|
|
54
|
+
height: /* @__PURE__ */ z.number()
|
|
55
|
+
});
|
|
56
|
+
//#endregion
|
|
57
|
+
export { MaskRectShapeSchema as a, MaskPolygonVerticesSchema as i, MaskGridShapeSchema as n, MaskShapeKindSchema as o, MaskPolygonShapeSchema as r, MaskGridDimsSchema as t };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
const require_quantity = require("./quantity-lY1KiTSZ.js");
|
|
2
|
+
let zod = require("zod");
|
|
3
|
+
//#region ../types/dist/esm/capabilities/mask-shape.mjs
|
|
4
|
+
/**
|
|
5
|
+
* Shared geometry vocabulary for on-frame shape caps — privacy-mask,
|
|
6
|
+
* motion-zones, and the detection zones/lines editor all speak this one
|
|
7
|
+
* language so a single drawing-plane editor and the providers stay
|
|
8
|
+
* decoupled from each cap's storage.
|
|
9
|
+
*
|
|
10
|
+
* All coordinates are normalized 0..1 of the camera frame (top-left
|
|
11
|
+
* origin). Each cap composes the SUBSET of shape kinds it supports and
|
|
12
|
+
* advertises it via `supportedShapes` in its `getOptions`.
|
|
13
|
+
*/
|
|
14
|
+
/** A normalized 0..1 point (top-left origin). */
|
|
15
|
+
var MaskPointSchema = /* @__PURE__ */ zod.z.object({
|
|
16
|
+
x: /* @__PURE__ */ zod.z.number(),
|
|
17
|
+
y: /* @__PURE__ */ zod.z.number()
|
|
18
|
+
});
|
|
19
|
+
/** Axis-aligned rectangle (normalized 0..1). */
|
|
20
|
+
var MaskRectShapeSchema = /* @__PURE__ */ zod.z.object({
|
|
21
|
+
kind: /* @__PURE__ */ zod.z.literal("rect"),
|
|
22
|
+
x: /* @__PURE__ */ zod.z.number(),
|
|
23
|
+
y: /* @__PURE__ */ zod.z.number(),
|
|
24
|
+
width: /* @__PURE__ */ zod.z.number(),
|
|
25
|
+
height: /* @__PURE__ */ zod.z.number()
|
|
26
|
+
});
|
|
27
|
+
/** Free polygon — an ordered list of normalized vertices (≥3). */
|
|
28
|
+
var MaskPolygonShapeSchema = /* @__PURE__ */ zod.z.object({
|
|
29
|
+
kind: /* @__PURE__ */ zod.z.literal("polygon"),
|
|
30
|
+
points: /* @__PURE__ */ zod.z.array(MaskPointSchema)
|
|
31
|
+
});
|
|
32
|
+
/** Boolean cell grid — row-major, length === gridWidth*gridHeight. */
|
|
33
|
+
var MaskGridShapeSchema = /* @__PURE__ */ zod.z.object({
|
|
34
|
+
kind: /* @__PURE__ */ zod.z.literal("grid"),
|
|
35
|
+
gridWidth: /* @__PURE__ */ zod.z.number().meta(/* @__PURE__ */ require_quantity.readingMeta("none")),
|
|
36
|
+
gridHeight: /* @__PURE__ */ zod.z.number().meta(/* @__PURE__ */ require_quantity.readingMeta("none")),
|
|
37
|
+
cells: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.boolean())
|
|
38
|
+
});
|
|
39
|
+
/** Every shape-kind discriminant, for `supportedShapes` advertisement. */
|
|
40
|
+
var MaskShapeKindSchema = /* @__PURE__ */ zod.z.enum([
|
|
41
|
+
"rect",
|
|
42
|
+
"polygon",
|
|
43
|
+
"grid",
|
|
44
|
+
"line"
|
|
45
|
+
]);
|
|
46
|
+
/** Polygon vertex bounds when a cap supports 'polygon' (e.g. Hikvision {min:4,max:4}). */
|
|
47
|
+
var MaskPolygonVerticesSchema = /* @__PURE__ */ zod.z.object({
|
|
48
|
+
min: /* @__PURE__ */ zod.z.number(),
|
|
49
|
+
max: /* @__PURE__ */ zod.z.number()
|
|
50
|
+
});
|
|
51
|
+
/** Grid dimensions when a cap supports 'grid'. */
|
|
52
|
+
var MaskGridDimsSchema = /* @__PURE__ */ zod.z.object({
|
|
53
|
+
width: /* @__PURE__ */ zod.z.number(),
|
|
54
|
+
height: /* @__PURE__ */ zod.z.number()
|
|
55
|
+
});
|
|
56
|
+
//#endregion
|
|
57
|
+
Object.defineProperty(exports, "MaskGridDimsSchema", {
|
|
58
|
+
enumerable: true,
|
|
59
|
+
get: function() {
|
|
60
|
+
return MaskGridDimsSchema;
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
Object.defineProperty(exports, "MaskGridShapeSchema", {
|
|
64
|
+
enumerable: true,
|
|
65
|
+
get: function() {
|
|
66
|
+
return MaskGridShapeSchema;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
Object.defineProperty(exports, "MaskPolygonShapeSchema", {
|
|
70
|
+
enumerable: true,
|
|
71
|
+
get: function() {
|
|
72
|
+
return MaskPolygonShapeSchema;
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
Object.defineProperty(exports, "MaskPolygonVerticesSchema", {
|
|
76
|
+
enumerable: true,
|
|
77
|
+
get: function() {
|
|
78
|
+
return MaskPolygonVerticesSchema;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
Object.defineProperty(exports, "MaskRectShapeSchema", {
|
|
82
|
+
enumerable: true,
|
|
83
|
+
get: function() {
|
|
84
|
+
return MaskRectShapeSchema;
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
Object.defineProperty(exports, "MaskShapeKindSchema", {
|
|
88
|
+
enumerable: true,
|
|
89
|
+
get: function() {
|
|
90
|
+
return MaskShapeKindSchema;
|
|
91
|
+
}
|
|
92
|
+
});
|