@camstack/system 1.2.27 → 1.2.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addon-runner.js +3 -3
- package/dist/addon-runner.mjs +2 -2
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/dist/builtins/alerts/alerts.addon.d.ts +0 -7
- package/dist/builtins/alerts/alerts.addon.js +47 -25
- package/dist/builtins/alerts/alerts.addon.mjs +47 -25
- package/dist/builtins/alerts/prune-policy.d.ts +44 -0
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/device-manager/device-manager.addon.js +1 -1
- package/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
- package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
- package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/local-auth/local-auth.addon.js +1 -1
- package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
- package/dist/builtins/local-network/local-network.addon.js +1 -1
- package/dist/builtins/local-network/local-network.addon.mjs +1 -1
- package/dist/builtins/loki-logging/index.js +1 -1
- package/dist/builtins/loki-logging/index.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/index.mjs +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings-backend.d.ts +7 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.d.ts +8 -2
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +22 -4
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +22 -4
- package/dist/builtins/storage-orchestrator/data-store-dispatch.d.ts +12 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.d.ts +18 -7
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +78 -11
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +78 -11
- package/dist/builtins/system-config/system-config.addon.js +1 -1
- package/dist/builtins/system-config/system-config.addon.mjs +1 -1
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{dist-BXmFvn3h.mjs → dist-B7hOpr5i.mjs} +411 -166
- package/dist/{dist-BxtIzexq.js → dist-CPmFYLqq.js} +416 -165
- package/dist/index.d.ts +2 -0
- package/dist/index.js +106 -2
- package/dist/index.mjs +102 -3
- package/dist/kernel/heap-watch.d.ts +36 -0
- package/dist/kernel/transport/uds-event-bus.d.ts +4 -1
- package/dist/{manifest-python-deps-KZ00cbfP.js → manifest-python-deps-BqE5j0-O.js} +25 -4
- package/dist/{manifest-python-deps-BNOApgK0.mjs → manifest-python-deps-Ck4-9K9m.mjs} +25 -4
- package/package.json +7 -3
package/dist/addon-runner.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
2
|
-
const require_manifest_python_deps = require("./manifest-python-deps-
|
|
2
|
+
const require_manifest_python_deps = require("./manifest-python-deps-BqE5j0-O.js");
|
|
3
3
|
const require_custom_action_registry = require("./custom-action-registry-jY0NOZK8.js");
|
|
4
|
+
let node_v8 = require("node:v8");
|
|
5
|
+
node_v8 = require_chunk.__toESM(node_v8);
|
|
4
6
|
let node_fs = require("node:fs");
|
|
5
7
|
node_fs = require_chunk.__toESM(node_fs);
|
|
6
8
|
let node_path = require("node:path");
|
|
7
9
|
node_path = require_chunk.__toESM(node_path);
|
|
8
10
|
let _camstack_types_addon = require("@camstack/types/addon");
|
|
9
11
|
let node_url = require("node:url");
|
|
10
|
-
let node_v8 = require("node:v8");
|
|
11
|
-
node_v8 = require_chunk.__toESM(node_v8);
|
|
12
12
|
let node_module = require("node:module");
|
|
13
13
|
//#region src/kernel/moleculer/worker-device-restore.ts
|
|
14
14
|
/**
|
package/dist/addon-runner.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Ct as resolveAddonClass, I as createUdsLoggerWithControl, L as LocalChildClient, at as setWorkerNativeCapsChangeListener, bt as installManifestNativeDeps, i as createUdsAddonContext, nt as getWorkerNativeCapProvider, rt as getWorkerNativeCapSnapshot, st as validateProviderRegistrations, t as installManifestPythonDeps } from "./manifest-python-deps-
|
|
1
|
+
import { Ct as resolveAddonClass, I as createUdsLoggerWithControl, L as LocalChildClient, at as setWorkerNativeCapsChangeListener, bt as installManifestNativeDeps, i as createUdsAddonContext, nt as getWorkerNativeCapProvider, rt as getWorkerNativeCapSnapshot, st as validateProviderRegistrations, t as installManifestPythonDeps } from "./manifest-python-deps-Ck4-9K9m.mjs";
|
|
2
2
|
import { t as CustomActionRegistry } from "./custom-action-registry-F__gp_VX.mjs";
|
|
3
3
|
import { register } from "node:module";
|
|
4
|
+
import * as v8 from "node:v8";
|
|
4
5
|
import * as fs from "node:fs";
|
|
5
6
|
import * as path$1 from "node:path";
|
|
6
7
|
import { ReadinessRegistry, ReadinessTimeoutError, errMsg, isCollectionArrayMethodName, normalizeAddonInitResult } from "@camstack/types/addon";
|
|
7
8
|
import { pathToFileURL } from "node:url";
|
|
8
|
-
import * as v8 from "node:v8";
|
|
9
9
|
//#region src/kernel/moleculer/worker-device-restore.ts
|
|
10
10
|
/**
|
|
11
11
|
* Worker-side device restore helper.
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-CPmFYLqq.js");
|
|
7
7
|
const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
|
|
8
8
|
let node_fs = require("node:fs");
|
|
9
9
|
node_fs = require_chunk.__toESM(node_fs);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Mt as EventCategory, at as errMsg, ot as BaseAddon, p as addonPagesCapability } from "../../dist-B7hOpr5i.mjs";
|
|
2
2
|
import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
|
|
3
3
|
import * as fs from "node:fs";
|
|
4
4
|
import * as path$1 from "node:path";
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-CPmFYLqq.js");
|
|
7
7
|
const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
|
|
8
8
|
let node_fs = require("node:fs");
|
|
9
9
|
node_fs = require_chunk.__toESM(node_fs);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Mt as EventCategory, at as errMsg, h as addonWidgetsCapability, ot as BaseAddon } from "../../dist-B7hOpr5i.mjs";
|
|
2
2
|
import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
|
|
3
3
|
import * as fs from "node:fs";
|
|
4
4
|
import * as path$1 from "node:path";
|
|
@@ -3,13 +3,6 @@ interface AlertCenterConfig {
|
|
|
3
3
|
readonly maxAlerts: number;
|
|
4
4
|
readonly retentionDays: number;
|
|
5
5
|
}
|
|
6
|
-
/**
|
|
7
|
-
* Alert Center addon — core builtin that persists alerts in a
|
|
8
|
-
* structured SQLite table and serves them to the admin UI.
|
|
9
|
-
*
|
|
10
|
-
* Registers as an `alerts` collection provider and subscribes to
|
|
11
|
-
* important EventBus categories to create/update alerts automatically.
|
|
12
|
-
*/
|
|
13
6
|
export declare class AlertCenterAddon extends BaseAddon<AlertCenterConfig> {
|
|
14
7
|
private unsubscribers;
|
|
15
8
|
constructor();
|
|
@@ -3,7 +3,30 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-CPmFYLqq.js");
|
|
7
|
+
//#region src/builtins/alerts/prune-policy.ts
|
|
8
|
+
/**
|
|
9
|
+
* Ids older than `cutoffMs`, oldest first.
|
|
10
|
+
*
|
|
11
|
+
* Read state is deliberately NOT consulted — that filter is the defect.
|
|
12
|
+
*/
|
|
13
|
+
function selectExpired(alerts, cutoffMs) {
|
|
14
|
+
return alerts.filter((a) => a.createdAt < cutoffMs).sort((a, b) => a.createdAt - b.createdAt).map((a) => a.id);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Ids to drop so at most `maxAlerts` remain: read ones first (oldest first),
|
|
18
|
+
* then unread ones (oldest first) if that was not enough.
|
|
19
|
+
*
|
|
20
|
+
* Returns empty when already within the cap, and never more than the excess.
|
|
21
|
+
*/
|
|
22
|
+
function selectOverflow(alerts, maxAlerts) {
|
|
23
|
+
if (maxAlerts < 0) return [];
|
|
24
|
+
const excess = alerts.length - maxAlerts;
|
|
25
|
+
if (excess <= 0) return [];
|
|
26
|
+
const byAge = [...alerts].sort((a, b) => a.createdAt - b.createdAt);
|
|
27
|
+
return [...byAge.filter((a) => a.read), ...byAge.filter((a) => !a.read)].slice(0, excess).map((a) => a.id);
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
7
30
|
//#region src/builtins/alerts/alerts.addon.ts
|
|
8
31
|
var CATEGORY_MAPPINGS = {
|
|
9
32
|
"addon.crashed": {
|
|
@@ -127,6 +150,14 @@ var EVENT_SOURCE = {
|
|
|
127
150
|
* Registers as an `alerts` collection provider and subscribes to
|
|
128
151
|
* important EventBus categories to create/update alerts automatically.
|
|
129
152
|
*/
|
|
153
|
+
/** Project a stored alert row onto the fields the prune policy needs. */
|
|
154
|
+
function toPrunable(record) {
|
|
155
|
+
return {
|
|
156
|
+
id: record.id,
|
|
157
|
+
createdAt: Number(record.data["createdAt"] ?? 0),
|
|
158
|
+
read: record.data["read"] === true
|
|
159
|
+
};
|
|
160
|
+
}
|
|
130
161
|
var AlertCenterAddon = class extends require_dist.BaseAddon {
|
|
131
162
|
unsubscribers = [];
|
|
132
163
|
constructor() {
|
|
@@ -557,42 +588,33 @@ var AlertCenterAddon = class extends require_dist.BaseAddon {
|
|
|
557
588
|
async enforceMaxAlerts() {
|
|
558
589
|
const backend = this.ctx.api.settingsStore;
|
|
559
590
|
if (!backend) return;
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
const excess = total - this.config.maxAlerts;
|
|
563
|
-
const oldest = await backend.query.query({
|
|
591
|
+
if (await backend.count.query({ collection: ALERTS_COLLECTION }) <= this.config.maxAlerts) return;
|
|
592
|
+
const all = await backend.query.query({
|
|
564
593
|
collection: ALERTS_COLLECTION,
|
|
565
|
-
filter: {
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
direction: "asc"
|
|
570
|
-
},
|
|
571
|
-
limit: excess
|
|
572
|
-
}
|
|
594
|
+
filter: { orderBy: {
|
|
595
|
+
field: "createdAt",
|
|
596
|
+
direction: "asc"
|
|
597
|
+
} }
|
|
573
598
|
});
|
|
574
|
-
for (const
|
|
599
|
+
for (const id of selectOverflow(all.map(toPrunable), this.config.maxAlerts)) await backend.delete.mutate({
|
|
575
600
|
collection: ALERTS_COLLECTION,
|
|
576
|
-
key:
|
|
601
|
+
key: id
|
|
577
602
|
});
|
|
578
603
|
}
|
|
579
604
|
async enforceRetention() {
|
|
580
605
|
const backend = this.ctx.api.settingsStore;
|
|
581
606
|
if (!backend) return;
|
|
582
607
|
const cutoff = Date.now() - this.config.retentionDays * 24 * 60 * 60 * 1e3;
|
|
583
|
-
const
|
|
608
|
+
const all = await backend.query.query({
|
|
584
609
|
collection: ALERTS_COLLECTION,
|
|
585
|
-
filter: {
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
direction: "asc"
|
|
590
|
-
}
|
|
591
|
-
}
|
|
610
|
+
filter: { orderBy: {
|
|
611
|
+
field: "createdAt",
|
|
612
|
+
direction: "asc"
|
|
613
|
+
} }
|
|
592
614
|
});
|
|
593
|
-
for (const
|
|
615
|
+
for (const id of selectExpired(all.map(toPrunable), cutoff)) await backend.delete.mutate({
|
|
594
616
|
collection: ALERTS_COLLECTION,
|
|
595
|
-
key:
|
|
617
|
+
key: id
|
|
596
618
|
});
|
|
597
619
|
}
|
|
598
620
|
};
|
|
@@ -1,4 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Mt as EventCategory, at as errMsg, g as alertsCapability, n as AlertSchema, ot as BaseAddon, yt as createEvent } from "../../dist-B7hOpr5i.mjs";
|
|
2
|
+
//#region src/builtins/alerts/prune-policy.ts
|
|
3
|
+
/**
|
|
4
|
+
* Ids older than `cutoffMs`, oldest first.
|
|
5
|
+
*
|
|
6
|
+
* Read state is deliberately NOT consulted — that filter is the defect.
|
|
7
|
+
*/
|
|
8
|
+
function selectExpired(alerts, cutoffMs) {
|
|
9
|
+
return alerts.filter((a) => a.createdAt < cutoffMs).sort((a, b) => a.createdAt - b.createdAt).map((a) => a.id);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Ids to drop so at most `maxAlerts` remain: read ones first (oldest first),
|
|
13
|
+
* then unread ones (oldest first) if that was not enough.
|
|
14
|
+
*
|
|
15
|
+
* Returns empty when already within the cap, and never more than the excess.
|
|
16
|
+
*/
|
|
17
|
+
function selectOverflow(alerts, maxAlerts) {
|
|
18
|
+
if (maxAlerts < 0) return [];
|
|
19
|
+
const excess = alerts.length - maxAlerts;
|
|
20
|
+
if (excess <= 0) return [];
|
|
21
|
+
const byAge = [...alerts].sort((a, b) => a.createdAt - b.createdAt);
|
|
22
|
+
return [...byAge.filter((a) => a.read), ...byAge.filter((a) => !a.read)].slice(0, excess).map((a) => a.id);
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
2
25
|
//#region src/builtins/alerts/alerts.addon.ts
|
|
3
26
|
var CATEGORY_MAPPINGS = {
|
|
4
27
|
"addon.crashed": {
|
|
@@ -122,6 +145,14 @@ var EVENT_SOURCE = {
|
|
|
122
145
|
* Registers as an `alerts` collection provider and subscribes to
|
|
123
146
|
* important EventBus categories to create/update alerts automatically.
|
|
124
147
|
*/
|
|
148
|
+
/** Project a stored alert row onto the fields the prune policy needs. */
|
|
149
|
+
function toPrunable(record) {
|
|
150
|
+
return {
|
|
151
|
+
id: record.id,
|
|
152
|
+
createdAt: Number(record.data["createdAt"] ?? 0),
|
|
153
|
+
read: record.data["read"] === true
|
|
154
|
+
};
|
|
155
|
+
}
|
|
125
156
|
var AlertCenterAddon = class extends BaseAddon {
|
|
126
157
|
unsubscribers = [];
|
|
127
158
|
constructor() {
|
|
@@ -552,42 +583,33 @@ var AlertCenterAddon = class extends BaseAddon {
|
|
|
552
583
|
async enforceMaxAlerts() {
|
|
553
584
|
const backend = this.ctx.api.settingsStore;
|
|
554
585
|
if (!backend) return;
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
const excess = total - this.config.maxAlerts;
|
|
558
|
-
const oldest = await backend.query.query({
|
|
586
|
+
if (await backend.count.query({ collection: ALERTS_COLLECTION }) <= this.config.maxAlerts) return;
|
|
587
|
+
const all = await backend.query.query({
|
|
559
588
|
collection: ALERTS_COLLECTION,
|
|
560
|
-
filter: {
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
direction: "asc"
|
|
565
|
-
},
|
|
566
|
-
limit: excess
|
|
567
|
-
}
|
|
589
|
+
filter: { orderBy: {
|
|
590
|
+
field: "createdAt",
|
|
591
|
+
direction: "asc"
|
|
592
|
+
} }
|
|
568
593
|
});
|
|
569
|
-
for (const
|
|
594
|
+
for (const id of selectOverflow(all.map(toPrunable), this.config.maxAlerts)) await backend.delete.mutate({
|
|
570
595
|
collection: ALERTS_COLLECTION,
|
|
571
|
-
key:
|
|
596
|
+
key: id
|
|
572
597
|
});
|
|
573
598
|
}
|
|
574
599
|
async enforceRetention() {
|
|
575
600
|
const backend = this.ctx.api.settingsStore;
|
|
576
601
|
if (!backend) return;
|
|
577
602
|
const cutoff = Date.now() - this.config.retentionDays * 24 * 60 * 60 * 1e3;
|
|
578
|
-
const
|
|
603
|
+
const all = await backend.query.query({
|
|
579
604
|
collection: ALERTS_COLLECTION,
|
|
580
|
-
filter: {
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
direction: "asc"
|
|
585
|
-
}
|
|
586
|
-
}
|
|
605
|
+
filter: { orderBy: {
|
|
606
|
+
field: "createdAt",
|
|
607
|
+
direction: "asc"
|
|
608
|
+
} }
|
|
587
609
|
});
|
|
588
|
-
for (const
|
|
610
|
+
for (const id of selectExpired(all.map(toPrunable), cutoff)) await backend.delete.mutate({
|
|
589
611
|
collection: ALERTS_COLLECTION,
|
|
590
|
-
key:
|
|
612
|
+
key: id
|
|
591
613
|
});
|
|
592
614
|
}
|
|
593
615
|
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* prune-policy — which alerts get deleted, as a pure decision.
|
|
3
|
+
*
|
|
4
|
+
* ## The bug this exists to prevent
|
|
5
|
+
*
|
|
6
|
+
* Both prune paths filtered `where: { read: true }`. On a live hub every one of
|
|
7
|
+
* 2,288 rows was UNREAD, so neither path had ever deleted anything — at roughly
|
|
8
|
+
* 128 new alerts a day, with `maxAlerts` and `retentionDays` both configured and
|
|
9
|
+
* both inert. A cap that only bounds rows a human has clicked is not a cap, and
|
|
10
|
+
* "retention (days)" that ignores age is not retention.
|
|
11
|
+
*
|
|
12
|
+
* The decision is extracted here because both callers were private methods
|
|
13
|
+
* inside the addon, reachable only through a running store — so the rule nobody
|
|
14
|
+
* could test is exactly the rule that was wrong.
|
|
15
|
+
*
|
|
16
|
+
* ## The two rules, and why they differ
|
|
17
|
+
*
|
|
18
|
+
* - **Age** ignores read state entirely. An alert past the retention window is
|
|
19
|
+
* expired whether or not anyone looked at it; that is what the operator set
|
|
20
|
+
* the number for.
|
|
21
|
+
* - **The cap** still PREFERS read alerts — an unread alert is more likely to
|
|
22
|
+
* matter, so it should be the last to go — but it must not stop there. Once
|
|
23
|
+
* the read ones are exhausted it keeps taking the oldest, or the cap silently
|
|
24
|
+
* is not one.
|
|
25
|
+
*/
|
|
26
|
+
/** The fields the policy needs. Anything else on the record is irrelevant. */
|
|
27
|
+
export interface PrunableAlert {
|
|
28
|
+
readonly id: string;
|
|
29
|
+
readonly createdAt: number;
|
|
30
|
+
readonly read: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Ids older than `cutoffMs`, oldest first.
|
|
34
|
+
*
|
|
35
|
+
* Read state is deliberately NOT consulted — that filter is the defect.
|
|
36
|
+
*/
|
|
37
|
+
export declare function selectExpired(alerts: readonly PrunableAlert[], cutoffMs: number): readonly string[];
|
|
38
|
+
/**
|
|
39
|
+
* Ids to drop so at most `maxAlerts` remain: read ones first (oldest first),
|
|
40
|
+
* then unread ones (oldest first) if that was not enough.
|
|
41
|
+
*
|
|
42
|
+
* Returns empty when already within the cap, and never more than the excess.
|
|
43
|
+
*/
|
|
44
|
+
export declare function selectOverflow(alerts: readonly PrunableAlert[], maxAlerts: number): readonly string[];
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-CPmFYLqq.js");
|
|
7
7
|
let node_fs = require("node:fs");
|
|
8
8
|
let node_fs$1 = require_chunk.__toESM(node_fs, 1);
|
|
9
9
|
node_fs = require_chunk.__toESM(node_fs);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Mt as EventCategory, ot as BaseAddon, y as backupCapability } from "../../dist-B7hOpr5i.mjs";
|
|
2
2
|
import * as fs from "node:fs";
|
|
3
3
|
import Kt from "node:fs";
|
|
4
4
|
import * as path$1 from "node:path";
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-CPmFYLqq.js");
|
|
7
7
|
const require_formatter = require("../../formatter-DqAKDlvN.js");
|
|
8
8
|
//#region src/builtins/console-logging/console-destination.ts
|
|
9
9
|
var LEVEL_RANK = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as logDestinationCapability, ot as BaseAddon } from "../../dist-B7hOpr5i.mjs";
|
|
2
2
|
import { t as formatLogLine } from "../../formatter-B7qW8bPJ.mjs";
|
|
3
3
|
//#region src/builtins/console-logging/console-destination.ts
|
|
4
4
|
var LEVEL_RANK = {
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-CPmFYLqq.js");
|
|
7
7
|
let _camstack_types_node = require("@camstack/types/node");
|
|
8
8
|
let zod = require("zod");
|
|
9
9
|
let node_crypto = require("node:crypto");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as deviceStateCapability, D as enumerateItemArrayFields, K as parseStreamParamsFormPatch, M as getByPath, Mt as EventCategory, O as enumerateSchemaFields, S as deviceManagerCapability, W as normalizeUnit, X as setByPath, _ as applyTransform, a as CAP_NAMES_WITH_STATUS, at as errMsg, b as buildStreamParamsConfigSchema, dt as DeviceRole, ft as DeviceType, ht as WELL_KNOWN_TAB_MAP, it as validateExpressionSource, jt as sleep, k as evaluateLinkExpression, l as STREAM_PROFILE_META, nt as toExpressionValue, o as DeviceStatusSchema, ot as BaseAddon, t as ALL_CAPABILITY_DEFINITIONS, ut as DeviceFeature, w as deviceStatusCapability, wt as isDeviceConfigCap } from "../../dist-B7hOpr5i.mjs";
|
|
2
2
|
import { canonicalDeviceFingerprint } from "@camstack/types/node";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-CPmFYLqq.js");
|
|
7
7
|
//#region src/builtins/doorbell/trigger-engine.ts
|
|
8
8
|
/**
|
|
9
9
|
* Pure trigger logic for the virtual-doorbell builtin — edge detection over
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Mt as EventCategory, T as doorbellCapability, at as errMsg, ft as DeviceType, ot as BaseAddon, yt as createEvent } from "../../dist-B7hOpr5i.mjs";
|
|
2
2
|
//#region src/builtins/doorbell/trigger-engine.ts
|
|
3
3
|
/**
|
|
4
4
|
* Pure trigger logic for the virtual-doorbell builtin — edge detection over
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-CPmFYLqq.js");
|
|
7
7
|
const require_formatter = require("../../formatter-DqAKDlvN.js");
|
|
8
8
|
//#region src/builtins/hub-forwarder/hub-forwarder-destination.ts
|
|
9
9
|
var DEFAULT_OUTBOUND_BUFFER_SIZE = 500;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as logDestinationCapability, ot as BaseAddon } from "../../dist-B7hOpr5i.mjs";
|
|
2
2
|
import { t as formatLogLine } from "../../formatter-B7qW8bPJ.mjs";
|
|
3
3
|
//#region src/builtins/hub-forwarder/hub-forwarder-destination.ts
|
|
4
4
|
var DEFAULT_OUTBOUND_BUFFER_SIZE = 500;
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-CPmFYLqq.js");
|
|
7
7
|
let node_crypto = require("node:crypto");
|
|
8
8
|
node_crypto = require_chunk.__toESM(node_crypto);
|
|
9
9
|
let crypto$1 = require("crypto");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as __require, o as __toESM, t as __commonJSMin } from "../../chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { f as UserRecordSchema, ot as BaseAddon, r as ApiKeyRecordSchema, rt as userManagementCapability, u as ScopedTokenSchema, v as authProviderCapability } from "../../dist-B7hOpr5i.mjs";
|
|
3
3
|
import * as crypto$1 from "node:crypto";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
import nodeCrypto from "crypto";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
3
|
-
const require_dist = require("../../dist-
|
|
3
|
+
const require_dist = require("../../dist-CPmFYLqq.js");
|
|
4
4
|
let node_os = require("node:os");
|
|
5
5
|
node_os = require_chunk.__toESM(node_os);
|
|
6
6
|
//#region src/builtins/local-network/local-network.addon.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Mt as EventCategory, ot as BaseAddon, z as localNetworkCapability } from "../../dist-B7hOpr5i.mjs";
|
|
2
2
|
import * as os from "node:os";
|
|
3
3
|
//#region src/builtins/local-network/local-network.addon.ts
|
|
4
4
|
/**
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-CPmFYLqq.js");
|
|
7
7
|
//#region src/builtins/loki-logging/loki-payload.ts
|
|
8
8
|
/**
|
|
9
9
|
* Loki rejects a label name that is not a valid Prometheus label
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as logDestinationCapability, ot as BaseAddon } from "../../dist-B7hOpr5i.mjs";
|
|
2
2
|
//#region src/builtins/loki-logging/loki-payload.ts
|
|
3
3
|
/**
|
|
4
4
|
* Loki rejects a label name that is not a valid Prometheus label
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-CPmFYLqq.js");
|
|
7
7
|
let node_fs = require("node:fs");
|
|
8
8
|
node_fs = require_chunk.__toESM(node_fs);
|
|
9
9
|
let node_child_process = require("node:child_process");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Mt as EventCategory, U as metricsProviderCapability, ot as BaseAddon, yt as createEvent } from "../../dist-B7hOpr5i.mjs";
|
|
2
2
|
import * as fs from "node:fs";
|
|
3
3
|
import { execFile, execFileSync } from "node:child_process";
|
|
4
4
|
import { promisify } from "node:util";
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-CPmFYLqq.js");
|
|
7
7
|
let node_fs = require("node:fs");
|
|
8
8
|
node_fs = require_chunk.__toESM(node_fs);
|
|
9
9
|
let node_child_process = require("node:child_process");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as __toESM } from "../../chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { E as enumerateInferenceDevices, Mt as EventCategory, Y as scoreRuntimes, at as errMsg, ot as BaseAddon, q as platformProbeCapability, xt as emitReadiness } from "../../dist-B7hOpr5i.mjs";
|
|
3
3
|
import * as fs from "node:fs";
|
|
4
4
|
import { execFile } from "node:child_process";
|
|
5
5
|
import { promisify } from "node:util";
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-CPmFYLqq.js");
|
|
7
7
|
//#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
|
|
8
8
|
/**
|
|
9
9
|
* Reconcile the durable `enabledProviders` set against authoritative
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Mt as EventCategory, ot as BaseAddon } from "../../dist-B7hOpr5i.mjs";
|
|
2
2
|
//#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
|
|
3
3
|
/**
|
|
4
4
|
* Reconcile the durable `enabledProviders` set against authoritative
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-CPmFYLqq.js");
|
|
7
7
|
let node_child_process = require("node:child_process");
|
|
8
8
|
//#region src/builtins/snapshot/snapshot-coalescing.ts
|
|
9
9
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Q as snapshotCapability, Tt as nodePin, at as errMsg, ft as DeviceType, i as BatteryStatusSchema, ot as BaseAddon, tt as streamQualityLabel, ut as DeviceFeature } from "../../dist-B7hOpr5i.mjs";
|
|
2
2
|
import { execFile } from "node:child_process";
|
|
3
3
|
//#region src/builtins/snapshot/snapshot-coalescing.ts
|
|
4
4
|
/**
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-CPmFYLqq.js");
|
|
7
7
|
let node_fs = require("node:fs");
|
|
8
8
|
node_fs = require_chunk.__toESM(node_fs);
|
|
9
9
|
let node_path = require("node:path");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { et as storageProviderCapability, j as filesystemBrowseCapability, ot as BaseAddon } from "../../dist-B7hOpr5i.mjs";
|
|
2
2
|
import * as fs from "node:fs";
|
|
3
3
|
import * as path$1 from "node:path";
|
|
4
4
|
import { basename, dirname, join, resolve, sep } from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as Database } from 'better-sqlite3';
|
|
2
|
-
import { ISettingsBackend, SettingsRecord, TableSchema, TableQueryOptions, SettingsGetInput, SettingsSetInput, SettingsQueryInput, SettingsInsertInput, SettingsUpdateInput, SettingsDeleteInput, SettingsCountInput, SettingsIsEmptyInput, SettingsHistogramInput, HistogramBucket, CollectionColumn, CollectionIndex } from '@camstack/types';
|
|
2
|
+
import { DataStoreEngineInfo, ISettingsBackend, SettingsRecord, TableSchema, TableQueryOptions, SettingsGetInput, SettingsSetInput, SettingsQueryInput, SettingsInsertInput, SettingsUpdateInput, SettingsDeleteInput, SettingsCountInput, SettingsIsEmptyInput, SettingsHistogramInput, HistogramBucket, CollectionColumn, CollectionIndex } from '@camstack/types';
|
|
3
3
|
/**
|
|
4
4
|
* SQLite implementation of ISettingsBackend.
|
|
5
5
|
*
|
|
@@ -39,6 +39,12 @@ export declare class SqliteSettingsBackend implements ISettingsBackend {
|
|
|
39
39
|
*/
|
|
40
40
|
private decodeColumnValue;
|
|
41
41
|
shutdown(): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* `data-store-provider` self-description — how the orchestrator names
|
|
44
|
+
* this engine in a log line, and (once collections declare an engine)
|
|
45
|
+
* how it picks between registrants.
|
|
46
|
+
*/
|
|
47
|
+
getEngineInfo(): Promise<DataStoreEngineInfo>;
|
|
42
48
|
get({ namespace, collection, key }: SettingsGetInput): Promise<unknown>;
|
|
43
49
|
set({ namespace, collection, key, value }: SettingsSetInput): Promise<void>;
|
|
44
50
|
query<T extends object = Record<string, unknown>>({ namespace, collection, filter, }: SettingsQueryInput): Promise<readonly SettingsRecord<T>[]>;
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { ProviderRegistration, BaseAddon } from '@camstack/types';
|
|
2
2
|
import { SqliteSettingsBackend } from './sqlite-settings-backend.js';
|
|
3
3
|
/**
|
|
4
|
-
* SQLite Settings addon —
|
|
5
|
-
*
|
|
4
|
+
* SQLite Settings addon — the relational ENGINE behind the data door.
|
|
5
|
+
*
|
|
6
|
+
* Capability: `data-store-provider` (collection, internal). It does not
|
|
7
|
+
* serve `settings-store`: that is the public door, owned by
|
|
8
|
+
* storage-orchestrator, which dispatches here
|
|
9
|
+
* ([D44](../../../../../docs/decisions/adr-0044.md)). Callers reach this
|
|
10
|
+
* engine only through the door — which is the point, because it is what
|
|
11
|
+
* makes the engine replaceable.
|
|
6
12
|
*/
|
|
7
13
|
export declare class SqliteSettingsAddon extends BaseAddon {
|
|
8
14
|
private backend;
|