@camstack/server 1.2.941 → 1.2.942
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 +14 -0
- package/dist/api/trpc/generated-cap-mounts.js +19 -1
- package/dist/api/trpc/generated-cap-routers.js +676 -596
- package/package.json +27 -11
- package/system/dist/action-index-B1fgpQBt.mjs +9925 -0
- package/system/dist/action-index-B_cLRwXJ.js +9972 -0
- package/system/dist/alert-episode-Be--PngO.mjs +64 -0
- package/system/dist/alert-episode-Bqktmt-i.js +93 -0
- package/system/dist/{base-addon-Md14i7pe.mjs → base-addon-BcS6r1cT.mjs} +20 -7
- package/system/dist/{base-addon-DD5dIfcZ.js → base-addon-CRsXtYFG.js} +20 -7
- package/system/dist/{base-device-CH8rfD9j.js → base-device-DAdWzDOl.js} +138 -34
- package/system/dist/{base-device-BcGO6LTT.mjs → base-device-DJXF5eDN.mjs} +138 -34
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/alerts/alert-episode-policy.d.ts +9 -5
- package/system/dist/builtins/alerts/alerts.addon.js +30 -80
- package/system/dist/builtins/alerts/alerts.addon.mjs +18 -68
- package/system/dist/builtins/autotrack/index.js +2 -2
- package/system/dist/builtins/autotrack/index.mjs +2 -2
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/calendars/calendars.addon.js +1 -1
- package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/system/dist/builtins/camera-grid/index.js +9 -9
- package/system/dist/builtins/camera-grid/index.mjs +6 -6
- package/system/dist/builtins/composer/composer.addon.js +99 -99
- package/system/dist/builtins/composer/composer.addon.mjs +11 -11
- package/system/dist/builtins/console-logging/index.js +1 -1
- package/system/dist/builtins/console-logging/index.mjs +1 -1
- package/system/dist/builtins/core-blocks/automation-template-instances.d.ts +14 -1
- package/system/dist/builtins/core-blocks/core-blocks.addon.d.ts +6 -0
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +296 -193
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +237 -134
- package/system/dist/builtins/core-blocks/link-contributions.d.ts +2 -0
- package/system/dist/builtins/core-notifier/core-notifier.addon.js +91 -18
- package/system/dist/builtins/core-notifier/core-notifier.addon.mjs +91 -18
- package/system/dist/builtins/core-notifier/group-notification-output.d.ts +8 -16
- package/system/dist/builtins/device-history/device-history.addon.d.ts +8 -0
- package/system/dist/builtins/device-history/device-history.addon.js +580 -60
- package/system/dist/builtins/device-history/device-history.addon.mjs +569 -49
- package/system/dist/builtins/device-history/retention/device-raw-overrides.d.ts +16 -0
- package/system/dist/builtins/device-history/retention/retention-knobs.d.ts +14 -0
- package/system/dist/builtins/device-history/retention/retention.d.ts +21 -1
- package/system/dist/builtins/device-history/transitions/change-coalescing.d.ts +48 -0
- package/system/dist/builtins/device-history/transitions/derived-changes.d.ts +49 -0
- package/system/dist/builtins/device-history/transitions/history-change-port.d.ts +20 -0
- package/system/dist/builtins/device-history/transitions/transitions-service.d.ts +18 -3
- package/system/dist/builtins/device-manager/device-identity-index.d.ts +2 -2
- package/system/dist/builtins/device-manager/device-manager.addon.js +177 -479
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +169 -471
- package/system/dist/builtins/device-manager/device-state-mirror.d.ts +0 -5
- package/system/dist/builtins/device-manager/identity-link-reconciler.d.ts +5 -0
- package/system/dist/builtins/device-manager/transitions/command-recorder.d.ts +38 -0
- package/system/dist/builtins/device-manager/transitions/transitions-wiring.d.ts +8 -9
- package/system/dist/builtins/hub-forwarder/index.js +1 -1
- package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/system/dist/builtins/keychain/index.js +2 -2
- package/system/dist/builtins/keychain/index.mjs +2 -2
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +2 -2
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +2 -2
- package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
- package/system/dist/builtins/local-network/address-book.d.ts +3 -1
- package/system/dist/builtins/local-network/local-network.addon.d.ts +26 -1
- package/system/dist/builtins/local-network/local-network.addon.js +66 -11
- package/system/dist/builtins/local-network/local-network.addon.mjs +66 -11
- package/system/dist/builtins/loki-logging/index.js +1 -1
- package/system/dist/builtins/loki-logging/index.mjs +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/system/dist/builtins/platform-probe/index.js +1 -1
- package/system/dist/builtins/platform-probe/index.mjs +1 -1
- package/system/dist/builtins/record-entries/index.js +1 -1
- package/system/dist/builtins/record-entries/index.mjs +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +4 -4
- package/system/dist/builtins/snapshot/index.mjs +4 -4
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- 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 +3 -3
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/system-config/system-config.addon.js +1 -1
- package/system/dist/builtins/system-config/system-config.addon.mjs +1 -1
- package/system/dist/builtins/winston-logging/index.js +1 -1
- package/system/dist/builtins/winston-logging/index.mjs +1 -1
- package/system/dist/{capture-engine-CUZ3W0oZ.mjs → capture-engine-B2MmoNND.mjs} +1 -1
- package/system/dist/{capture-engine-mtDXEBAq.js → capture-engine-D_1IJmMs.js} +1 -1
- package/system/dist/command-catalog-C29hVOOg.js +210 -0
- package/system/dist/command-catalog-xAeqxbZk.mjs +169 -0
- package/system/dist/{error.cap-DCwbIGEF.mjs → compile-OBMHlqD-.mjs} +97 -100
- package/system/dist/{error.cap-BxLEHP6z.js → compile-SpeAhaZ6.js} +107 -116
- package/system/dist/{composition-sources-B56CU8hi.mjs → composition-sources-C327LGFn.mjs} +2 -2
- package/system/dist/{composition-sources-D_Bfwji0.js → composition-sources-Do5qM6EB.js} +17 -17
- package/system/dist/{core-blocks.cap-xt5_fK5Z.js → core-blocks.cap-CdTGUKtr.js} +194 -10110
- package/system/dist/{core-blocks.cap-DDECcMeI.mjs → core-blocks.cap-DLkEfV5b.mjs} +54 -9910
- package/system/dist/{device-kind-BJ2pfsjw.mjs → device-kind-C37Ra2wd.mjs} +4 -2
- package/system/dist/{device-kind-CsSiv_YF.js → device-kind-FMhJg8uC.js} +4 -2
- package/system/dist/{device-manager.cap-DyHOIh5T.js → device-manager.cap-DJs8izI6.js} +13 -4
- package/system/dist/{device-manager.cap-DIBK62-r.mjs → device-manager.cap-eYrj1Ezp.mjs} +13 -4
- package/system/dist/{device-provider.cap-BKUGJSo0.js → device-provider.cap-CNlYBQ5D.js} +1 -1
- package/system/dist/{device-provider.cap-DU6HMUXH.mjs → device-provider.cap-D8mJllVM.mjs} +1 -1
- package/system/dist/{device-row-store-O4mNbp5q.js → device-row-store-C0P2H18h.js} +2 -2
- package/system/dist/{device-row-store-C-_R-h1Z.mjs → device-row-store-CTocYKqC.mjs} +2 -2
- package/system/dist/{device-type-CbQsnFdC.js → device-type-Cnc0NiSX.js} +13 -0
- package/system/dist/{device-type-DgEvK3ch.mjs → device-type-TUGqGmaI.mjs} +13 -0
- package/system/dist/error.cap-BuKbL3Ac.js +125 -0
- package/system/dist/error.cap-CU1FB6uE.mjs +102 -0
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{history-catalog-BwTeQ4Mr.mjs → history-catalog-A_dzXNpv.mjs} +98 -3
- package/system/dist/{history-catalog-BKRarIL_.js → history-catalog-CiTMP3-E.js} +98 -3
- package/system/dist/index.js +28 -6
- package/system/dist/index.mjs +28 -6
- package/system/dist/kernel/addon-version-policy.d.ts +10 -0
- package/system/dist/{legacy-integration-rows-door-B1nzxxr5.js → legacy-integration-rows-door-CdqYAj-o.js} +1 -1
- package/system/dist/{legacy-integration-rows-door-nTvo_6jQ.mjs → legacy-integration-rows-door-LSgpClpX.mjs} +1 -1
- package/system/dist/{low-power-sleep.cap-B6mz6ojP.js → low-power-sleep.cap-BJWyAuUQ.js} +1 -1
- package/system/dist/{low-power-sleep.cap-C3Vi8Vxj.mjs → low-power-sleep.cap-D9Orx3LS.mjs} +1 -1
- package/system/dist/migrations/hub/2026-11-22-device-transitions-commands-only.d.ts +10 -0
- package/system/dist/{network-access.cap-BEN_uRVb.js → network-access.cap-CTQ2WQoi.js} +38 -12
- package/system/dist/{network-access.cap-Dy8FNNVs.mjs → network-access.cap-Dx5K0I5i.mjs} +33 -13
- package/system/dist/{notification-rules.cap-Drwz-A4n.js → notification-rules.cap-BJKUjizS.js} +45 -9
- package/system/dist/{notification-rules.cap-0vVvsxQ1.mjs → notification-rules.cap-BUIuYPlQ.mjs} +45 -9
- package/system/dist/{notification-targets-DR-D-vIt.mjs → notification-targets-4bGYH5J7.mjs} +2 -2
- package/system/dist/{notification-targets-Cc_3OBH9.js → notification-targets-DMW7xgR2.js} +2 -2
- package/system/dist/{prefix-walk-CCO_VZVo.js → prefix-walk-BFnw8NBu.js} +5 -5
- package/system/dist/{prefix-walk-BhT0ZoKl.mjs → prefix-walk-Mtij0NNT.mjs} +2 -2
- package/system/dist/{ptz-autotrack.cap-DOz0xL0O.js → ptz-autotrack.cap-B9eyZU8w.js} +1 -1
- package/system/dist/{ptz-autotrack.cap-CDF6FeTK.mjs → ptz-autotrack.cap-Dw2k-po9.mjs} +1 -1
- package/system/dist/{recording-archive.cap-RHAN45fa.mjs → recording-archive.cap-CTlm86R8.mjs} +1 -1
- package/system/dist/{recording-archive.cap-BPJ7kvnd.js → recording-archive.cap-Wo-hEZhz.js} +1 -1
- package/system/dist/{rename-composition-block-DWUkrazx.mjs → rename-composition-block-Cdh-dRmY.mjs} +395 -20
- package/system/dist/{rename-composition-block-CH2vRIW7.js → rename-composition-block-D9Uc1AF7.js} +406 -31
- package/system/dist/{retention-CUOVI1p7.mjs → retention-CQs8QR1B.mjs} +33 -3
- package/system/dist/{device-transitions.cap-DCXP3zwY.mjs → retention-source.cap-550kkyp5.mjs} +98 -21
- package/system/dist/{device-transitions.cap-zOGvAIHz.js → retention-source.cap-C6Hy0hlM.js} +103 -20
- package/system/dist/{retention-BcOSL6b9.js → retention-xcjk_k1w.js} +33 -3
- package/system/dist/{snapshot.cap-Cis6JRwn.js → snapshot.cap-CHm29hBs.js} +1 -1
- package/system/dist/{snapshot.cap-BkfHpJVO.mjs → snapshot.cap-CO68YvJU.mjs} +1 -1
- package/system/dist/{stream-catalog.cap-D8Y-uXcy.js → stream-catalog.cap-CjEQFknc.js} +2 -2
- package/system/dist/{stream-catalog.cap-D1Hy19Yc.mjs → stream-catalog.cap-DVniDdRD.mjs} +2 -2
- package/system/dist/{user-management.cap-Ctd4c_im.mjs → user-management.cap-4IEUCSdL.mjs} +2 -2
- package/system/dist/{user-management.cap-DyVb68rY.js → user-management.cap-DV9Jfsj3.js} +2 -2
- package/system/dist/{wal-maintenance-CjpslZUL.mjs → wal-maintenance-Bey5ChBb.mjs} +0 -0
- package/system/dist/{wal-maintenance-DKTXQ7UF.js → wal-maintenance-BgYiAy5b.js} +0 -0
- package/system/package.json +4 -1
- package/system/dist/builtins/device-manager/transitions/transition-correlator.d.ts +0 -81
package/system/dist/{device-transitions.cap-DCXP3zwY.mjs → retention-source.cap-550kkyp5.mjs}
RENAMED
|
@@ -2,7 +2,7 @@ import { c as method, d as systemMethod } from "./capability-definition-C1TLUVJR
|
|
|
2
2
|
import { t as OnBehalfSchema } from "./command-origin-claim-D1Wy7Qld.mjs";
|
|
3
3
|
import { t as NOT_A_DEVICE } from "./system-reasons-CYj4qwyS.mjs";
|
|
4
4
|
import { a as readingMeta } from "./quantity-D3g5SxsZ.mjs";
|
|
5
|
-
import { r as DeviceType } from "./device-type-
|
|
5
|
+
import { r as DeviceType } from "./device-type-TUGqGmaI.mjs";
|
|
6
6
|
import { t } from "./l10n-Bu6aUvSY.mjs";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
//#region ../types/dist/esm/audit/device-transition.mjs
|
|
@@ -10,11 +10,13 @@ import { z } from "zod";
|
|
|
10
10
|
* One recorded device transition (D1022): a status field of a device went from
|
|
11
11
|
* one value to another, with who or what asked for it.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* (`
|
|
17
|
-
*
|
|
13
|
+
* Two kinds of row share this shape (D1084). A STORED row is a command: who asked
|
|
14
|
+
* for what, when, with which arguments, and whether the call threw (`outcome`
|
|
15
|
+
* `ok` | `failed`); `field`, `from` and `to` are what the command's vocabulary
|
|
16
|
+
* effect names (`*` and `null` when it names none). A DERIVED row (`outcome`
|
|
17
|
+
* `device`, actor `device`) is a change of an audited field read back from the
|
|
18
|
+
* device-history raw series; it is never stored. `from` is `null` when the
|
|
19
|
+
* previous value is unknown (never a made-up value - D393).
|
|
18
20
|
*/
|
|
19
21
|
/** A status value as a transition carries it. */
|
|
20
22
|
var TransitionValueSchema = /* @__PURE__ */ z.union([
|
|
@@ -76,21 +78,16 @@ var TransitionActorKindSchema = /* @__PURE__ */ z.enum([
|
|
|
76
78
|
"node",
|
|
77
79
|
"device"
|
|
78
80
|
]);
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
"unconfirmed",
|
|
84
|
-
"failed"
|
|
85
|
-
]);
|
|
81
|
+
/** How a command call ended: it returned (`ok`) or it threw (`failed`). Nothing says the device obeyed. */
|
|
82
|
+
var TransitionOutcomeSchema = /* @__PURE__ */ z.enum(["ok", "failed"]);
|
|
83
|
+
/** A row's outcome: a command's, or `device` for a change derived from history (never stored). */
|
|
84
|
+
var TransitionRowOutcomeSchema = /* @__PURE__ */ z.union([TransitionOutcomeSchema, /* @__PURE__ */ z.literal("device")]);
|
|
86
85
|
/** The command a transition is attributed to. `args` are redacted and capped before they get here. */
|
|
87
86
|
var TransitionCommandSchema = /* @__PURE__ */ z.object({
|
|
88
87
|
commandId: /* @__PURE__ */ z.string(),
|
|
89
88
|
method: /* @__PURE__ */ z.string(),
|
|
90
89
|
args: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.unknown()),
|
|
91
90
|
requestedAt: /* @__PURE__ */ z.number(),
|
|
92
|
-
/** Milliseconds from the command to the change it caused; `null` when no change was seen. */
|
|
93
|
-
matchedAfterMs: /* @__PURE__ */ z.number().nullable(),
|
|
94
91
|
error: /* @__PURE__ */ z.string().optional()
|
|
95
92
|
});
|
|
96
93
|
var DeviceTransitionSchema = /* @__PURE__ */ z.object({
|
|
@@ -102,7 +99,7 @@ var DeviceTransitionSchema = /* @__PURE__ */ z.object({
|
|
|
102
99
|
field: /* @__PURE__ */ z.string(),
|
|
103
100
|
from: TransitionValueSchema,
|
|
104
101
|
to: TransitionValueSchema,
|
|
105
|
-
outcome:
|
|
102
|
+
outcome: TransitionRowOutcomeSchema,
|
|
106
103
|
actor: TransitionActorSchema,
|
|
107
104
|
command: /* @__PURE__ */ TransitionCommandSchema.optional()
|
|
108
105
|
});
|
|
@@ -775,8 +772,10 @@ var deviceTransitionsCapability = {
|
|
|
775
772
|
deviceTypes: /* @__PURE__ */ Object.values(DeviceType).filter((type) => type !== DeviceType.Container),
|
|
776
773
|
methods: {
|
|
777
774
|
/**
|
|
778
|
-
*
|
|
779
|
-
* At most ONE of `capName`, `actorKind`, `outcome` per call
|
|
775
|
+
* Commands and derived device changes, newest first. `limit` is bounded; page with `cursor`
|
|
776
|
+
* (stable across both sources). At most ONE of `capName`, `actorKind`, `outcome` per call;
|
|
777
|
+
* `outcome` (`ok` | `failed`) and every actor kind but `device` select commands only,
|
|
778
|
+
* `actorKind: 'device'` selects derived changes only.
|
|
780
779
|
*/
|
|
781
780
|
listTransitions: /* @__PURE__ */ method(/* @__PURE__ */ z.object({
|
|
782
781
|
deviceId: /* @__PURE__ */ z.number().int(),
|
|
@@ -791,12 +790,12 @@ var deviceTransitionsCapability = {
|
|
|
791
790
|
transitions: /* @__PURE__ */ z.array(DeviceTransitionSchema).readonly(),
|
|
792
791
|
nextCursor: /* @__PURE__ */ z.string().nullable()
|
|
793
792
|
})),
|
|
794
|
-
/** Fetch one
|
|
793
|
+
/** Fetch one stored command by id; null when absent (a derived change has no stored row). */
|
|
795
794
|
getTransition: /* @__PURE__ */ method(/* @__PURE__ */ z.object({
|
|
796
795
|
deviceId: /* @__PURE__ */ z.number().int(),
|
|
797
796
|
id: /* @__PURE__ */ z.string()
|
|
798
797
|
}), /* @__PURE__ */ DeviceTransitionSchema.nullable()),
|
|
799
|
-
/** The fleet page, newest first. At most ONE of `actorKind`, `outcome` per call. */
|
|
798
|
+
/** The fleet page of stored commands, newest first (derived device changes are per device only). At most ONE of `actorKind`, `outcome` per call. */
|
|
800
799
|
listRecentTransitions: /* @__PURE__ */ systemMethod(/* @__PURE__ */ z.object({
|
|
801
800
|
actorKind: /* @__PURE__ */ TransitionActorKindSchema.optional(),
|
|
802
801
|
outcome: /* @__PURE__ */ TransitionOutcomeSchema.optional(),
|
|
@@ -822,4 +821,82 @@ var deviceTransitionsCapability = {
|
|
|
822
821
|
}
|
|
823
822
|
};
|
|
824
823
|
//#endregion
|
|
825
|
-
|
|
824
|
+
//#region ../types/dist/esm/capabilities/retention-source.cap.mjs
|
|
825
|
+
/**
|
|
826
|
+
* `retention-source` — the one place the operator reads every retention knob
|
|
827
|
+
* of the system (D1084). A collection cap: each addon that keeps data for a
|
|
828
|
+
* bounded time registers a provider and lists its OWN knobs; the hub's collection
|
|
829
|
+
* fan-out concatenates the answers, so there is no central list to forget to edit
|
|
830
|
+
* and the admin UI (Data → Retention, the device page) hardcodes none.
|
|
831
|
+
*
|
|
832
|
+
* A knob never stores anything here. It is a read of a setting the owner already
|
|
833
|
+
* has, plus the way to write it back: `write` names the existing settings call
|
|
834
|
+
* (`addonSettings.updateScopedSettings` for a cluster knob, `updateDeviceSettings`
|
|
835
|
+
* for a device override). The owner stays the only authority for the value.
|
|
836
|
+
*
|
|
837
|
+
* `scope: 'cluster'` — one value for the system. `scope: 'device'` — a cluster
|
|
838
|
+
* default that a device may override: without `deviceId` the knob is listed with
|
|
839
|
+
* the cluster default; with `deviceId` only the device-scoped knobs of that device
|
|
840
|
+
* are listed, each saying whether it is `inherited` or overridden.
|
|
841
|
+
*/
|
|
842
|
+
var RetentionScopeSchema = /* @__PURE__ */ z.enum(["cluster", "device"]);
|
|
843
|
+
var RetentionUnitSchema = /* @__PURE__ */ z.enum([
|
|
844
|
+
"days",
|
|
845
|
+
"hours",
|
|
846
|
+
"count"
|
|
847
|
+
]);
|
|
848
|
+
/** How to write a knob back: the settings call that already owns it. */
|
|
849
|
+
var RetentionWriteSchema = /* @__PURE__ */ z.discriminatedUnion("method", [/* @__PURE__ */ z.object({
|
|
850
|
+
method: /* @__PURE__ */ z.literal("updateScopedSettings"),
|
|
851
|
+
addonId: /* @__PURE__ */ z.string().min(1),
|
|
852
|
+
cap: /* @__PURE__ */ z.string().min(1),
|
|
853
|
+
scope: /* @__PURE__ */ z.enum(["cluster", "node"]),
|
|
854
|
+
key: /* @__PURE__ */ z.string().min(1)
|
|
855
|
+
}), /* @__PURE__ */ z.object({
|
|
856
|
+
method: /* @__PURE__ */ z.literal("updateDeviceSettings"),
|
|
857
|
+
addonId: /* @__PURE__ */ z.string().min(1),
|
|
858
|
+
key: /* @__PURE__ */ z.string().min(1)
|
|
859
|
+
})]);
|
|
860
|
+
var RetentionKnobSchema = /* @__PURE__ */ z.object({
|
|
861
|
+
/** Stable id: `<addonId>:<key>`. */
|
|
862
|
+
id: /* @__PURE__ */ z.string().min(1),
|
|
863
|
+
/** The addon that owns, reads and enforces the knob. */
|
|
864
|
+
owner: /* @__PURE__ */ z.string().min(1),
|
|
865
|
+
/** Settings key inside the owner. */
|
|
866
|
+
key: /* @__PURE__ */ z.string().min(1),
|
|
867
|
+
/** i18n key of the label (`retention.<owner>.<key>`). */
|
|
868
|
+
labelKey: /* @__PURE__ */ z.string().min(1),
|
|
869
|
+
/** English fallback when the key has no translation. */
|
|
870
|
+
label: /* @__PURE__ */ z.string().min(1),
|
|
871
|
+
/** Groups knobs of one subject on the page (`history`, `events`, `logs`, …). */
|
|
872
|
+
group: /* @__PURE__ */ z.string().min(1),
|
|
873
|
+
unit: RetentionUnitSchema,
|
|
874
|
+
/** What the owner uses when nothing is set. */
|
|
875
|
+
defaultValue: /* @__PURE__ */ z.number().nullable(),
|
|
876
|
+
/** The effective value now (a device listing: the device's own, else the inherited one). `null`: unknown. */
|
|
877
|
+
value: /* @__PURE__ */ z.number().nullable(),
|
|
878
|
+
min: /* @__PURE__ */ z.number().optional(),
|
|
879
|
+
max: /* @__PURE__ */ z.number().optional(),
|
|
880
|
+
/** `0` means keep forever for this knob. */
|
|
881
|
+
zeroMeansForever: /* @__PURE__ */ z.boolean(),
|
|
882
|
+
scope: RetentionScopeSchema,
|
|
883
|
+
/** Device listing only: the device the answer is about. */
|
|
884
|
+
deviceId: /* @__PURE__ */ z.number().int().optional(),
|
|
885
|
+
/** Device-scoped knob: `true` while the device follows the cluster value. */
|
|
886
|
+
inherited: /* @__PURE__ */ z.boolean().optional(),
|
|
887
|
+
/** Device-scoped knob: the cluster value the device would inherit. */
|
|
888
|
+
inheritedValue: /* @__PURE__ */ z.number().nullable().optional(),
|
|
889
|
+
write: RetentionWriteSchema
|
|
890
|
+
});
|
|
891
|
+
var retentionSourceCapability = {
|
|
892
|
+
name: "retention-source",
|
|
893
|
+
scope: "system",
|
|
894
|
+
mode: "collection",
|
|
895
|
+
internal: true,
|
|
896
|
+
methods: {
|
|
897
|
+
/** List the retention knobs this addon owns; with `deviceId`, the device-scoped ones for that device. */
|
|
898
|
+
listRetentionKnobs: /* @__PURE__ */ method(/* @__PURE__ */ z.object({ deviceId: /* @__PURE__ */ z.number().int().positive().optional() }), /* @__PURE__ */ z.array(RetentionKnobSchema).readonly(), { auth: "admin" }) },
|
|
899
|
+
vocabulary: { notOperatorFacing: NOT_A_DEVICE.INTERNAL }
|
|
900
|
+
};
|
|
901
|
+
//#endregion
|
|
902
|
+
export { deviceRemovalHookCapability as a, DeviceTransitionSchema as c, deviceRunsCapability as i, deviceTransitionsCapability as n, DEVICE_HISTORY_ENERGY_KEY as o, DeviceRunSchema as r, deviceHistoryCapability as s, retentionSourceCapability as t };
|
|
@@ -2,7 +2,7 @@ const require_capability_definition = require("./capability-definition-BEVd01Xj.
|
|
|
2
2
|
const require_command_origin_claim = require("./command-origin-claim-Cief660O.js");
|
|
3
3
|
const require_system_reasons = require("./system-reasons-Be_k1W8g.js");
|
|
4
4
|
const require_quantity = require("./quantity-lY1KiTSZ.js");
|
|
5
|
-
const require_device_type = require("./device-type-
|
|
5
|
+
const require_device_type = require("./device-type-Cnc0NiSX.js");
|
|
6
6
|
const require_l10n = require("./l10n-CGMvp7NF.js");
|
|
7
7
|
let zod = require("zod");
|
|
8
8
|
//#region ../types/dist/esm/audit/device-transition.mjs
|
|
@@ -10,11 +10,13 @@ let zod = require("zod");
|
|
|
10
10
|
* One recorded device transition (D1022): a status field of a device went from
|
|
11
11
|
* one value to another, with who or what asked for it.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* (`
|
|
17
|
-
*
|
|
13
|
+
* Two kinds of row share this shape (D1084). A STORED row is a command: who asked
|
|
14
|
+
* for what, when, with which arguments, and whether the call threw (`outcome`
|
|
15
|
+
* `ok` | `failed`); `field`, `from` and `to` are what the command's vocabulary
|
|
16
|
+
* effect names (`*` and `null` when it names none). A DERIVED row (`outcome`
|
|
17
|
+
* `device`, actor `device`) is a change of an audited field read back from the
|
|
18
|
+
* device-history raw series; it is never stored. `from` is `null` when the
|
|
19
|
+
* previous value is unknown (never a made-up value - D393).
|
|
18
20
|
*/
|
|
19
21
|
/** A status value as a transition carries it. */
|
|
20
22
|
var TransitionValueSchema = /* @__PURE__ */ zod.z.union([
|
|
@@ -76,21 +78,16 @@ var TransitionActorKindSchema = /* @__PURE__ */ zod.z.enum([
|
|
|
76
78
|
"node",
|
|
77
79
|
"device"
|
|
78
80
|
]);
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
"unconfirmed",
|
|
84
|
-
"failed"
|
|
85
|
-
]);
|
|
81
|
+
/** How a command call ended: it returned (`ok`) or it threw (`failed`). Nothing says the device obeyed. */
|
|
82
|
+
var TransitionOutcomeSchema = /* @__PURE__ */ zod.z.enum(["ok", "failed"]);
|
|
83
|
+
/** A row's outcome: a command's, or `device` for a change derived from history (never stored). */
|
|
84
|
+
var TransitionRowOutcomeSchema = /* @__PURE__ */ zod.z.union([TransitionOutcomeSchema, /* @__PURE__ */ zod.z.literal("device")]);
|
|
86
85
|
/** The command a transition is attributed to. `args` are redacted and capped before they get here. */
|
|
87
86
|
var TransitionCommandSchema = /* @__PURE__ */ zod.z.object({
|
|
88
87
|
commandId: /* @__PURE__ */ zod.z.string(),
|
|
89
88
|
method: /* @__PURE__ */ zod.z.string(),
|
|
90
89
|
args: /* @__PURE__ */ zod.z.record(/* @__PURE__ */ zod.z.string(), /* @__PURE__ */ zod.z.unknown()),
|
|
91
90
|
requestedAt: /* @__PURE__ */ zod.z.number(),
|
|
92
|
-
/** Milliseconds from the command to the change it caused; `null` when no change was seen. */
|
|
93
|
-
matchedAfterMs: /* @__PURE__ */ zod.z.number().nullable(),
|
|
94
91
|
error: /* @__PURE__ */ zod.z.string().optional()
|
|
95
92
|
});
|
|
96
93
|
var DeviceTransitionSchema = /* @__PURE__ */ zod.z.object({
|
|
@@ -102,7 +99,7 @@ var DeviceTransitionSchema = /* @__PURE__ */ zod.z.object({
|
|
|
102
99
|
field: /* @__PURE__ */ zod.z.string(),
|
|
103
100
|
from: TransitionValueSchema,
|
|
104
101
|
to: TransitionValueSchema,
|
|
105
|
-
outcome:
|
|
102
|
+
outcome: TransitionRowOutcomeSchema,
|
|
106
103
|
actor: TransitionActorSchema,
|
|
107
104
|
command: /* @__PURE__ */ TransitionCommandSchema.optional()
|
|
108
105
|
});
|
|
@@ -775,8 +772,10 @@ var deviceTransitionsCapability = {
|
|
|
775
772
|
deviceTypes: /* @__PURE__ */ Object.values(require_device_type.DeviceType).filter((type) => type !== require_device_type.DeviceType.Container),
|
|
776
773
|
methods: {
|
|
777
774
|
/**
|
|
778
|
-
*
|
|
779
|
-
* At most ONE of `capName`, `actorKind`, `outcome` per call
|
|
775
|
+
* Commands and derived device changes, newest first. `limit` is bounded; page with `cursor`
|
|
776
|
+
* (stable across both sources). At most ONE of `capName`, `actorKind`, `outcome` per call;
|
|
777
|
+
* `outcome` (`ok` | `failed`) and every actor kind but `device` select commands only,
|
|
778
|
+
* `actorKind: 'device'` selects derived changes only.
|
|
780
779
|
*/
|
|
781
780
|
listTransitions: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
|
|
782
781
|
deviceId: /* @__PURE__ */ zod.z.number().int(),
|
|
@@ -791,12 +790,12 @@ var deviceTransitionsCapability = {
|
|
|
791
790
|
transitions: /* @__PURE__ */ zod.z.array(DeviceTransitionSchema).readonly(),
|
|
792
791
|
nextCursor: /* @__PURE__ */ zod.z.string().nullable()
|
|
793
792
|
})),
|
|
794
|
-
/** Fetch one
|
|
793
|
+
/** Fetch one stored command by id; null when absent (a derived change has no stored row). */
|
|
795
794
|
getTransition: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
|
|
796
795
|
deviceId: /* @__PURE__ */ zod.z.number().int(),
|
|
797
796
|
id: /* @__PURE__ */ zod.z.string()
|
|
798
797
|
}), /* @__PURE__ */ DeviceTransitionSchema.nullable()),
|
|
799
|
-
/** The fleet page, newest first. At most ONE of `actorKind`, `outcome` per call. */
|
|
798
|
+
/** The fleet page of stored commands, newest first (derived device changes are per device only). At most ONE of `actorKind`, `outcome` per call. */
|
|
800
799
|
listRecentTransitions: /* @__PURE__ */ require_capability_definition.systemMethod(/* @__PURE__ */ zod.z.object({
|
|
801
800
|
actorKind: /* @__PURE__ */ TransitionActorKindSchema.optional(),
|
|
802
801
|
outcome: /* @__PURE__ */ TransitionOutcomeSchema.optional(),
|
|
@@ -822,6 +821,84 @@ var deviceTransitionsCapability = {
|
|
|
822
821
|
}
|
|
823
822
|
};
|
|
824
823
|
//#endregion
|
|
824
|
+
//#region ../types/dist/esm/capabilities/retention-source.cap.mjs
|
|
825
|
+
/**
|
|
826
|
+
* `retention-source` — the one place the operator reads every retention knob
|
|
827
|
+
* of the system (D1084). A collection cap: each addon that keeps data for a
|
|
828
|
+
* bounded time registers a provider and lists its OWN knobs; the hub's collection
|
|
829
|
+
* fan-out concatenates the answers, so there is no central list to forget to edit
|
|
830
|
+
* and the admin UI (Data → Retention, the device page) hardcodes none.
|
|
831
|
+
*
|
|
832
|
+
* A knob never stores anything here. It is a read of a setting the owner already
|
|
833
|
+
* has, plus the way to write it back: `write` names the existing settings call
|
|
834
|
+
* (`addonSettings.updateScopedSettings` for a cluster knob, `updateDeviceSettings`
|
|
835
|
+
* for a device override). The owner stays the only authority for the value.
|
|
836
|
+
*
|
|
837
|
+
* `scope: 'cluster'` — one value for the system. `scope: 'device'` — a cluster
|
|
838
|
+
* default that a device may override: without `deviceId` the knob is listed with
|
|
839
|
+
* the cluster default; with `deviceId` only the device-scoped knobs of that device
|
|
840
|
+
* are listed, each saying whether it is `inherited` or overridden.
|
|
841
|
+
*/
|
|
842
|
+
var RetentionScopeSchema = /* @__PURE__ */ zod.z.enum(["cluster", "device"]);
|
|
843
|
+
var RetentionUnitSchema = /* @__PURE__ */ zod.z.enum([
|
|
844
|
+
"days",
|
|
845
|
+
"hours",
|
|
846
|
+
"count"
|
|
847
|
+
]);
|
|
848
|
+
/** How to write a knob back: the settings call that already owns it. */
|
|
849
|
+
var RetentionWriteSchema = /* @__PURE__ */ zod.z.discriminatedUnion("method", [/* @__PURE__ */ zod.z.object({
|
|
850
|
+
method: /* @__PURE__ */ zod.z.literal("updateScopedSettings"),
|
|
851
|
+
addonId: /* @__PURE__ */ zod.z.string().min(1),
|
|
852
|
+
cap: /* @__PURE__ */ zod.z.string().min(1),
|
|
853
|
+
scope: /* @__PURE__ */ zod.z.enum(["cluster", "node"]),
|
|
854
|
+
key: /* @__PURE__ */ zod.z.string().min(1)
|
|
855
|
+
}), /* @__PURE__ */ zod.z.object({
|
|
856
|
+
method: /* @__PURE__ */ zod.z.literal("updateDeviceSettings"),
|
|
857
|
+
addonId: /* @__PURE__ */ zod.z.string().min(1),
|
|
858
|
+
key: /* @__PURE__ */ zod.z.string().min(1)
|
|
859
|
+
})]);
|
|
860
|
+
var RetentionKnobSchema = /* @__PURE__ */ zod.z.object({
|
|
861
|
+
/** Stable id: `<addonId>:<key>`. */
|
|
862
|
+
id: /* @__PURE__ */ zod.z.string().min(1),
|
|
863
|
+
/** The addon that owns, reads and enforces the knob. */
|
|
864
|
+
owner: /* @__PURE__ */ zod.z.string().min(1),
|
|
865
|
+
/** Settings key inside the owner. */
|
|
866
|
+
key: /* @__PURE__ */ zod.z.string().min(1),
|
|
867
|
+
/** i18n key of the label (`retention.<owner>.<key>`). */
|
|
868
|
+
labelKey: /* @__PURE__ */ zod.z.string().min(1),
|
|
869
|
+
/** English fallback when the key has no translation. */
|
|
870
|
+
label: /* @__PURE__ */ zod.z.string().min(1),
|
|
871
|
+
/** Groups knobs of one subject on the page (`history`, `events`, `logs`, …). */
|
|
872
|
+
group: /* @__PURE__ */ zod.z.string().min(1),
|
|
873
|
+
unit: RetentionUnitSchema,
|
|
874
|
+
/** What the owner uses when nothing is set. */
|
|
875
|
+
defaultValue: /* @__PURE__ */ zod.z.number().nullable(),
|
|
876
|
+
/** The effective value now (a device listing: the device's own, else the inherited one). `null`: unknown. */
|
|
877
|
+
value: /* @__PURE__ */ zod.z.number().nullable(),
|
|
878
|
+
min: /* @__PURE__ */ zod.z.number().optional(),
|
|
879
|
+
max: /* @__PURE__ */ zod.z.number().optional(),
|
|
880
|
+
/** `0` means keep forever for this knob. */
|
|
881
|
+
zeroMeansForever: /* @__PURE__ */ zod.z.boolean(),
|
|
882
|
+
scope: RetentionScopeSchema,
|
|
883
|
+
/** Device listing only: the device the answer is about. */
|
|
884
|
+
deviceId: /* @__PURE__ */ zod.z.number().int().optional(),
|
|
885
|
+
/** Device-scoped knob: `true` while the device follows the cluster value. */
|
|
886
|
+
inherited: /* @__PURE__ */ zod.z.boolean().optional(),
|
|
887
|
+
/** Device-scoped knob: the cluster value the device would inherit. */
|
|
888
|
+
inheritedValue: /* @__PURE__ */ zod.z.number().nullable().optional(),
|
|
889
|
+
write: RetentionWriteSchema
|
|
890
|
+
});
|
|
891
|
+
var retentionSourceCapability = {
|
|
892
|
+
name: "retention-source",
|
|
893
|
+
scope: "system",
|
|
894
|
+
mode: "collection",
|
|
895
|
+
internal: true,
|
|
896
|
+
methods: {
|
|
897
|
+
/** List the retention knobs this addon owns; with `deviceId`, the device-scoped ones for that device. */
|
|
898
|
+
listRetentionKnobs: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({ deviceId: /* @__PURE__ */ zod.z.number().int().positive().optional() }), /* @__PURE__ */ zod.z.array(RetentionKnobSchema).readonly(), { auth: "admin" }) },
|
|
899
|
+
vocabulary: { notOperatorFacing: require_system_reasons.NOT_A_DEVICE.INTERNAL }
|
|
900
|
+
};
|
|
901
|
+
//#endregion
|
|
825
902
|
Object.defineProperty(exports, "DEVICE_HISTORY_ENERGY_KEY", {
|
|
826
903
|
enumerable: true,
|
|
827
904
|
get: function() {
|
|
@@ -864,3 +941,9 @@ Object.defineProperty(exports, "deviceTransitionsCapability", {
|
|
|
864
941
|
return deviceTransitionsCapability;
|
|
865
942
|
}
|
|
866
943
|
});
|
|
944
|
+
Object.defineProperty(exports, "retentionSourceCapability", {
|
|
945
|
+
enumerable: true,
|
|
946
|
+
get: function() {
|
|
947
|
+
return retentionSourceCapability;
|
|
948
|
+
}
|
|
949
|
+
});
|
|
@@ -92,11 +92,20 @@ var DepartureTracker = class {
|
|
|
92
92
|
//#region src/builtins/device-history/retention/retention.ts
|
|
93
93
|
var DEFAULT_RETENTION = {
|
|
94
94
|
rawDays: 7,
|
|
95
|
+
rawDiscreteDays: 30,
|
|
95
96
|
fiveMinuteDays: 30,
|
|
96
97
|
hourDays: 365,
|
|
97
98
|
dayDays: null,
|
|
98
99
|
transitionDays: 365
|
|
99
100
|
};
|
|
101
|
+
function isDiscrete(kind) {
|
|
102
|
+
return kind === "boolean" || kind === "enum";
|
|
103
|
+
}
|
|
104
|
+
/** Days one series keeps its raw points: its device's override, else the cluster value for its kind. */
|
|
105
|
+
function rawDaysFor(kind, policy, override) {
|
|
106
|
+
if (isDiscrete(kind)) return override?.rawDiscreteDays ?? policy.rawDiscreteDays;
|
|
107
|
+
return override?.rawDays ?? policy.rawDays;
|
|
108
|
+
}
|
|
100
109
|
/** Rows of the transition ledger strictly older than this are deleted; the row AT it is kept. */
|
|
101
110
|
function transitionCutoff(policy, now) {
|
|
102
111
|
return now - policy.transitionDays * DAY_MS;
|
|
@@ -142,6 +151,7 @@ var RetentionJob = class {
|
|
|
142
151
|
appliedUpTo = /* @__PURE__ */ new Map();
|
|
143
152
|
running = null;
|
|
144
153
|
transitions = null;
|
|
154
|
+
deviceOverrides = null;
|
|
145
155
|
constructor(deps) {
|
|
146
156
|
this.deps = deps;
|
|
147
157
|
}
|
|
@@ -149,6 +159,10 @@ var RetentionJob = class {
|
|
|
149
159
|
attachTransitions(sweeper) {
|
|
150
160
|
this.transitions = sweeper;
|
|
151
161
|
}
|
|
162
|
+
/** Per-device raw windows (the addon's per-device store); read once per pass. */
|
|
163
|
+
attachDeviceOverrides(reader) {
|
|
164
|
+
this.deviceOverrides = reader;
|
|
165
|
+
}
|
|
152
166
|
run(policy, now) {
|
|
153
167
|
if (this.running !== null) return this.running;
|
|
154
168
|
const run = this.doRun(policy, now).finally(() => {
|
|
@@ -161,12 +175,15 @@ var RetentionJob = class {
|
|
|
161
175
|
const { registry, counters, logger } = this.deps;
|
|
162
176
|
const cutoffs = retentionCutoffs(policy, now);
|
|
163
177
|
try {
|
|
178
|
+
const overrides = await this.readOverrides();
|
|
164
179
|
for (const tier of TIERS) {
|
|
165
|
-
|
|
166
|
-
if (cutoff === null) continue;
|
|
180
|
+
if (tier === "raw" && overrides === null) continue;
|
|
167
181
|
for (const series of registry.all()) {
|
|
182
|
+
const metric = registry.metric(series.key);
|
|
183
|
+
const cutoff = tier === "raw" ? now - rawDaysFor(metric?.kind, policy, series.deviceId === null ? void 0 : overrides?.get(series.deviceId)) * DAY_MS : cutoffs[tier];
|
|
184
|
+
if (cutoff === null) continue;
|
|
168
185
|
if (series.firstTs - 864e5 >= cutoff) continue;
|
|
169
|
-
if (tier === "raw" &&
|
|
186
|
+
if (tier === "raw" && metric?.ingest === "buckets") continue;
|
|
170
187
|
const marker = `${tier}:${series.id}`;
|
|
171
188
|
const applied = this.appliedUpTo.get(marker);
|
|
172
189
|
if (applied !== void 0 && cutoff - applied < RETENTION_STEP_MS[tier]) continue;
|
|
@@ -182,6 +199,19 @@ var RetentionJob = class {
|
|
|
182
199
|
logger.warn("device-history: retention pass failed — retried at the next run", { meta: { error: err instanceof Error ? err.message : String(err) } });
|
|
183
200
|
}
|
|
184
201
|
}
|
|
202
|
+
/**
|
|
203
|
+
* `null` when the read failed: a longer override must not be judged by the cluster
|
|
204
|
+
* window, so the raw tier waits for the next pass (D49) — it never deletes blind.
|
|
205
|
+
*/
|
|
206
|
+
async readOverrides() {
|
|
207
|
+
if (this.deviceOverrides === null) return /* @__PURE__ */ new Map();
|
|
208
|
+
try {
|
|
209
|
+
return await this.deviceOverrides();
|
|
210
|
+
} catch (err) {
|
|
211
|
+
this.deps.logger.warn("device-history: per-device raw windows unreadable — raw tier skipped this pass", { meta: { error: err instanceof Error ? err.message : String(err) } });
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
185
215
|
/** The fifth step: the transition ledger, under its own failure so the tiers never wait on it. */
|
|
186
216
|
async sweepTransitions(policy, now) {
|
|
187
217
|
const sweeper = this.transitions;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_capability_definition = require("./capability-definition-BEVd01Xj.js");
|
|
2
|
-
const require_device_type = require("./device-type-
|
|
2
|
+
const require_device_type = require("./device-type-Cnc0NiSX.js");
|
|
3
3
|
const require_l10n = require("./l10n-CGMvp7NF.js");
|
|
4
4
|
let zod = require("zod");
|
|
5
5
|
//#region ../types/dist/esm/capabilities/snapshot.cap.mjs
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as method, d as systemMethod } from "./capability-definition-C1TLUVJR.mjs";
|
|
2
|
-
import { r as DeviceType } from "./device-type-
|
|
2
|
+
import { r as DeviceType } from "./device-type-TUGqGmaI.mjs";
|
|
3
3
|
import { t } from "./l10n-Bu6aUvSY.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region ../types/dist/esm/capabilities/snapshot.cap.mjs
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const require_streaming_shared = require("./streaming-shared-DQwFZOSi.js");
|
|
2
|
-
const require_base_addon = require("./base-addon-
|
|
2
|
+
const require_base_addon = require("./base-addon-CRsXtYFG.js");
|
|
3
3
|
const require_capability_definition = require("./capability-definition-BEVd01Xj.js");
|
|
4
4
|
const require_system_reasons = require("./system-reasons-Be_k1W8g.js");
|
|
5
5
|
const require_ops_log = require("./ops-log-pxt9176Z.js");
|
|
6
6
|
const require_quantity = require("./quantity-lY1KiTSZ.js");
|
|
7
7
|
const require_relocate = require("./relocate-CdVQAk-w.js");
|
|
8
|
-
const require_device_type = require("./device-type-
|
|
8
|
+
const require_device_type = require("./device-type-Cnc0NiSX.js");
|
|
9
9
|
const require_l10n = require("./l10n-CGMvp7NF.js");
|
|
10
10
|
const require_mask_shape = require("./mask-shape-CmPA2fst.js");
|
|
11
11
|
let zod = require("zod");
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { a as CamStreamResolutionSchema, i as CamStreamKindSchema, l as FrameHandleSchema, r as CamProfileSchema, t as AudioStreamPickSchema } from "./streaming-shared-B8cXatuU.mjs";
|
|
2
|
-
import { b as EventCategory } from "./base-addon-
|
|
2
|
+
import { b as EventCategory } from "./base-addon-BcS6r1cT.mjs";
|
|
3
3
|
import { c as method } from "./capability-definition-C1TLUVJR.mjs";
|
|
4
4
|
import { t as NOT_A_DEVICE } from "./system-reasons-CYj4qwyS.mjs";
|
|
5
5
|
import { n as OpsLogQueryInputSchema, r as OpsLogReasonSchema, t as OpsLogEntrySchema } from "./ops-log-CB4pIdqi.mjs";
|
|
6
6
|
import { a as readingMeta } from "./quantity-D3g5SxsZ.mjs";
|
|
7
7
|
import { a as RelocatableMediaCountInputSchema, b as StorageMigrationMediaMoveInputSchema, c as RelocateJobSchema, i as MediaLocationCensusSchema, l as RelocateMediaInputSchema, o as RelocatableMediaCountSchema, r as MediaLocationCensusInputSchema, w as UnstampedEventMediaCountSchema, y as StorageMigrationLeaseInputSchema } from "./relocate-CoZZTui1.mjs";
|
|
8
|
-
import { r as DeviceType } from "./device-type-
|
|
8
|
+
import { r as DeviceType } from "./device-type-TUGqGmaI.mjs";
|
|
9
9
|
import { t } from "./l10n-Bu6aUvSY.mjs";
|
|
10
10
|
import { a as MaskRectShapeSchema, r as MaskPolygonShapeSchema } from "./mask-shape-Ci8Co9w0.mjs";
|
|
11
11
|
import { z } from "zod";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c as method } from "./capability-definition-C1TLUVJR.mjs";
|
|
2
2
|
import { t as NOT_A_DEVICE } from "./system-reasons-CYj4qwyS.mjs";
|
|
3
|
-
import { r as DeviceType } from "./device-type-
|
|
4
|
-
import { t as canonicalStoredDeviceType } from "./device-kind-
|
|
3
|
+
import { r as DeviceType } from "./device-type-TUGqGmaI.mjs";
|
|
4
|
+
import { t as canonicalStoredDeviceType } from "./device-kind-C37Ra2wd.mjs";
|
|
5
5
|
import { a as DeviceCredentialSchema, o as DeviceCredentialStatusSchema, s as StartEnrollmentOutputSchema } from "./device-certificate-Cddm4Idn.mjs";
|
|
6
6
|
import { n as RawSecretMigrationReportSchema, t as RawSecretMigrationInputSchema } from "./raw-secret-migration-iv88mLoc.mjs";
|
|
7
7
|
import { z } from "zod";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_capability_definition = require("./capability-definition-BEVd01Xj.js");
|
|
2
2
|
const require_system_reasons = require("./system-reasons-Be_k1W8g.js");
|
|
3
|
-
const require_device_type = require("./device-type-
|
|
4
|
-
const require_device_kind = require("./device-kind-
|
|
3
|
+
const require_device_type = require("./device-type-Cnc0NiSX.js");
|
|
4
|
+
const require_device_kind = require("./device-kind-FMhJg8uC.js");
|
|
5
5
|
const require_device_certificate = require("./device-certificate-CguVACQO.js");
|
|
6
6
|
const require_raw_secret_migration = require("./raw-secret-migration-DxuBFtvi.js");
|
|
7
7
|
let zod = require("zod");
|
|
Binary file
|
|
Binary file
|
package/system/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/server",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.942",
|
|
4
4
|
"description": "CamStack builtins — shipped inside @camstack/server (generated, do not edit)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"camstack": {
|
|
@@ -241,6 +241,9 @@
|
|
|
241
241
|
},
|
|
242
242
|
{
|
|
243
243
|
"name": "device-transitions"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"name": "retention-source"
|
|
244
247
|
}
|
|
245
248
|
]
|
|
246
249
|
},
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The correlator of the device transition audit (D1022).
|
|
3
|
-
*
|
|
4
|
-
* A command (what the kernel saw leave its caller) and a slice change (what the
|
|
5
|
-
* hub mirror saw land) are two facts about one event. This module pairs them:
|
|
6
|
-
* a change of an audited field is attributed to the newest pending command whose
|
|
7
|
-
* effect names that field and value, else to a command with no effect (toggle,
|
|
8
|
-
* press), else to the device itself. A command whose target already held is
|
|
9
|
-
* `already`; one that produced nothing inside its window is `unconfirmed`; one
|
|
10
|
-
* the caller saw throw is `failed`.
|
|
11
|
-
*
|
|
12
|
-
* Pure and clock-injected. It reads memory only (D49): the pending ring and the
|
|
13
|
-
* mirror's current slice. Nothing here does I/O, so a state write never waits on
|
|
14
|
-
* the audit; what it produces is handed to `emit`, whose queue is bounded.
|
|
15
|
-
*/
|
|
16
|
-
import { type DeviceCommandObservation, type DeviceTransition, type IScopedLogger, type TransitionValue } from "@camstack/types";
|
|
17
|
-
/** How long a command waits for the change it should cause. */
|
|
18
|
-
export declare const COMMAND_MATCH_WINDOW_MS = 3e4;
|
|
19
|
-
/** Pending commands kept per (device, cap); the oldest is expired when a ninth arrives. */
|
|
20
|
-
export declare const PENDING_RING_MAX = 8;
|
|
21
|
-
/**
|
|
22
|
-
* A cap's audited fields are SETTLED before they are written: changes are held as one burst per
|
|
23
|
-
* (device, cap) and written, one row per field, when the burst ends. It ends when a pending
|
|
24
|
-
* command is matched by its effect (written at once, credited to the command), or when the cap
|
|
25
|
-
* has been quiet for this long. A cover that reports `open`, `position 6`, `opening`, then `open`
|
|
26
|
-
* and `position 100` is one change per field (`closed -> open`, `0 -> 100`), not five.
|
|
27
|
-
*/
|
|
28
|
-
export declare const SETTLE_QUIET_MS = 5e3;
|
|
29
|
-
/** A burst that never goes quiet (a flapping sensor) is written anyway after this long. */
|
|
30
|
-
export declare const SETTLE_MAX_HOLD_MS = 6e4;
|
|
31
|
-
/** The field of a row whose command named none (a toggle that changed nothing we saw). */
|
|
32
|
-
export declare const NO_FIELD = "*";
|
|
33
|
-
export type CurrentSlice = (deviceId: number, capName: string) => Readonly<Record<string, unknown>> | undefined;
|
|
34
|
-
export interface CorrelatorDeps {
|
|
35
|
-
/** Optional: names the branches that write nothing (a there-and-back field, a dropped burst). */
|
|
36
|
-
readonly logger?: IScopedLogger;
|
|
37
|
-
readonly now: () => number;
|
|
38
|
-
readonly currentSlice: CurrentSlice;
|
|
39
|
-
readonly emit: (transition: DeviceTransition) => void;
|
|
40
|
-
/** The command's arguments as a row stores them: redacted by the input schema's secret paths and capped. */
|
|
41
|
-
readonly prepareArgs: (capName: string, method: string, args: Readonly<Record<string, unknown>>) => Record<string, unknown>;
|
|
42
|
-
}
|
|
43
|
-
/** A status value in the shape a transition stores: unknown is `null` (D393), an array is wrapped. */
|
|
44
|
-
export declare function toTransitionValue(value: unknown): TransitionValue;
|
|
45
|
-
export declare class TransitionCorrelator {
|
|
46
|
-
private readonly deps;
|
|
47
|
-
private readonly pending;
|
|
48
|
-
private seq;
|
|
49
|
-
private readonly held;
|
|
50
|
-
constructor(deps: CorrelatorDeps);
|
|
51
|
-
/** A command left its caller. */
|
|
52
|
-
recordCommand(obs: DeviceCommandObservation): void;
|
|
53
|
-
/** The mirror stored a new native slice for `capName` (the previous one, if any, is `prior`). */
|
|
54
|
-
onSliceChange(deviceId: number, capName: string, prior: Readonly<Record<string, unknown>> | undefined, slice: Readonly<Record<string, unknown>>): void;
|
|
55
|
-
private hasLiveCommand;
|
|
56
|
-
/** Write every held burst now (shutdown): a held change must not be lost (D49). */
|
|
57
|
-
flush(): void;
|
|
58
|
-
/** The fields of a burst that ended somewhere other than where they started. */
|
|
59
|
-
private netChanges;
|
|
60
|
-
private flushBurst;
|
|
61
|
-
private confirmWithoutNet;
|
|
62
|
-
private pruneSettled;
|
|
63
|
-
private flushDue;
|
|
64
|
-
/** The newest live command whose effect one of `changes` fulfils, if any. */
|
|
65
|
-
private commandMatchedBy;
|
|
66
|
-
/** Expire every pending command past its window. Driven by the sender's tick. */
|
|
67
|
-
sweep(): void;
|
|
68
|
-
/** Commands still waiting, for a status read. */
|
|
69
|
-
pendingCount(): number;
|
|
70
|
-
/** Forget a removed device's pending commands. */
|
|
71
|
-
forgetDevice(deviceId: number): void;
|
|
72
|
-
private attribute;
|
|
73
|
-
private expire;
|
|
74
|
-
private fail;
|
|
75
|
-
private emit;
|
|
76
|
-
/** A change nobody asked for. */
|
|
77
|
-
private writeDevice;
|
|
78
|
-
private keyOf;
|
|
79
|
-
private nextId;
|
|
80
|
-
private nextCommandId;
|
|
81
|
-
}
|