@camstack/server 1.2.783 → 1.2.784
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/package.json +14 -10
- package/system/dist/addon-utils.js +1 -1
- package/system/dist/addon-utils.mjs +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +2 -2
- 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 +2 -2
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/alerts/alerts.addon.d.ts +6 -0
- package/system/dist/builtins/alerts/alerts.addon.js +240 -17
- package/system/dist/builtins/alerts/alerts.addon.mjs +264 -50
- package/system/dist/builtins/alerts/runner-alert.d.ts +6 -1
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +5 -5
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +3 -3
- package/system/dist/builtins/camera-grid/index.js +1 -1
- package/system/dist/builtins/camera-grid/index.mjs +1 -1
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +3 -3
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
- package/system/dist/builtins/keychain/index.js +1 -1
- package/system/dist/builtins/keychain/index.mjs +1 -1
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +3 -3
- 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 +1 -1
- package/system/dist/builtins/local-network/local-network.addon.js +2 -2
- package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +2 -2
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +2 -2
- package/system/dist/builtins/platform-probe/index.js +2 -2
- package/system/dist/builtins/platform-probe/index.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +1 -1
- package/system/dist/builtins/snapshot/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +3 -3
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +2 -2
- 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 +2 -2
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +2 -2
- package/system/dist/builtins/system-config/system-config.addon.js +4 -4
- package/system/dist/builtins/system-config/system-config.addon.mjs +3 -3
- package/system/dist/builtins/winston-logging/index.js +1 -1
- package/system/dist/builtins/winston-logging/index.mjs +1 -1
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-mdns-ciao-DHlokCDH.js → hub-mdns-ciao-DYD3STlf.js} +3 -3
- package/system/dist/{hub-mdns-ciao-DWzAoaKF.mjs → hub-mdns-ciao-VOfs7CqC.mjs} +3 -3
- package/system/dist/index.js +29 -112
- package/system/dist/index.mjs +23 -106
- package/system/dist/kernel/moleculer/process-service.d.ts +3 -0
- package/system/dist/kernel/moleculer/runner-failure-info.d.ts +13 -0
- package/system/dist/log-file-read-worker.js +1 -1
- package/system/dist/log-file-read-worker.mjs +1 -1
- package/system/package.json +1 -1
- package/system/dist/{agent-https-kG6BvwKf.js → agent-https-BobAhSU6.js} +1 -1
- package/system/dist/{agent-https-CEBLv9BA.mjs → agent-https-Ds3-zbz-.mjs} +1 -1
- package/system/dist/{custom-action-registry-oHl1xltx.mjs → custom-action-registry-B9zFBNVa.mjs} +3 -3
- package/system/dist/{custom-action-registry-JuMHGKEc.js → custom-action-registry-CmWpSeMS.js} +3 -3
- package/system/dist/{log-file-read-protocol-D0WcLbIV.js → log-file-read-protocol-DSV_vQRb.js} +2 -2
- package/system/dist/{log-file-read-protocol-B7M3X3bT.mjs → log-file-read-protocol-hTaAsYlX.mjs} +1 -1
- package/system/dist/{restore-archive-CfET1ups.mjs → restore-archive-B2l00XlI.mjs} +4 -4
- package/system/dist/{restore-archive-ChBlqNSj.js → restore-archive-BCXQaw89.js} +6 -6
- package/system/dist/{wal-maintenance-CNSrfmr8.js → wal-maintenance-Z4MNv6Vn.js} +0 -0
- package/system/dist/{wal-maintenance-Bg3rwpny.mjs → wal-maintenance-bvjbNKbx.mjs} +0 -0
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { Ao as BaseAddon, Rr as isAlertEpisodeOpen, Ts as defineRecordKinds, _c as EventCategory, bs as createEvent, d as AlertSchema, gc as errMsg, hn as alertsCapability, mn as alertEpisodePayload, pn as alertEpisodeId, zr as isAlertEpisodeSeverity } from "../../dist-W0Eyg7Fm.mjs";
|
|
1
|
+
import { Ao as BaseAddon, C as CORE_BLOCK_ADDON_PREFIX, Rr as isAlertEpisodeOpen, Ts as defineRecordKinds, _c as EventCategory$1, bs as createEvent$1, d as AlertSchema, gc as errMsg$1, hn as alertsCapability, mn as alertEpisodePayload, pn as alertEpisodeId, zr as isAlertEpisodeSeverity } from "../../dist-W0Eyg7Fm.mjs";
|
|
2
2
|
import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
|
|
3
|
+
import * as fs$1 from "node:fs";
|
|
4
|
+
import * as path$1 from "node:path";
|
|
5
|
+
import { maskUrlCredentials, scrubKnownSecrets } from "@camstack/types/addon";
|
|
3
6
|
//#region src/builtins/alerts/alert-episode-policy.ts
|
|
4
7
|
/**
|
|
5
8
|
* When does an alert open a new EPISODE, and which edge of it is announced?
|
|
@@ -109,6 +112,152 @@ function selectOverflow(alerts, maxAlerts) {
|
|
|
109
112
|
return [...byAge.filter((a) => a.read), ...byAge.filter((a) => !a.read)].slice(0, excess).map((a) => a.id);
|
|
110
113
|
}
|
|
111
114
|
//#endregion
|
|
115
|
+
//#region src/logging/log-redactor.ts
|
|
116
|
+
var REDACTED = "***";
|
|
117
|
+
/** Credential-named keys. Substring, case-insensitive; only STRING values are replaced. */
|
|
118
|
+
var SECRET_KEY_SUBSTRINGS = [
|
|
119
|
+
"password",
|
|
120
|
+
"passwd",
|
|
121
|
+
"secret",
|
|
122
|
+
"token",
|
|
123
|
+
"apikey",
|
|
124
|
+
"api_key",
|
|
125
|
+
"authkey",
|
|
126
|
+
"auth_key",
|
|
127
|
+
"privatekey",
|
|
128
|
+
"private_key",
|
|
129
|
+
"passphrase",
|
|
130
|
+
"credential",
|
|
131
|
+
"cookie"
|
|
132
|
+
];
|
|
133
|
+
/** True when a meta key names a credential. */
|
|
134
|
+
function isCredentialKeyName(key) {
|
|
135
|
+
const lower = key.toLowerCase();
|
|
136
|
+
return SECRET_KEY_SUBSTRINGS.some((needle) => lower.includes(needle));
|
|
137
|
+
}
|
|
138
|
+
var URL_IN_TEXT = /\b[a-z][a-z0-9+.-]*:\/\/[^\s"'<>`]+/gi;
|
|
139
|
+
/** A root-relative path WITH a query, as request logs print it. */
|
|
140
|
+
var RELATIVE_URL_IN_TEXT = /(^|[\s"'(=])(\/[^\s"'<>`?]*\?[^\s"'<>`]+)/g;
|
|
141
|
+
var CREDENTIAL_FLAG = /(--(?:token|auth-?key|password|passwd|pass|secret|api-?key|access-?token|refresh-?token)(?:=|\s+))(\S+)/gi;
|
|
142
|
+
/** Redact one free-form string. */
|
|
143
|
+
function redactLogText(text) {
|
|
144
|
+
let out = scrubKnownSecrets(text);
|
|
145
|
+
if (out.includes("://")) out = out.replace(URL_IN_TEXT, (url) => maskUrlCredentials(url));
|
|
146
|
+
if (out.includes("/") && out.includes("?") && out.includes("=")) out = out.replace(RELATIVE_URL_IN_TEXT, (_m, lead, path) => `${lead}${maskUrlCredentials(path)}`);
|
|
147
|
+
if (out.includes("--")) out = out.replace(CREDENTIAL_FLAG, (_m, flag, value) => value.startsWith("‹secret:") ? `${flag}${value}` : `${flag}${REDACTED}`);
|
|
148
|
+
return out;
|
|
149
|
+
}
|
|
150
|
+
/** Bounds on the meta walk — a log line is not a place to traverse a graph. */
|
|
151
|
+
var MAX_DEPTH = 8;
|
|
152
|
+
var MAX_NODES = 2e3;
|
|
153
|
+
/**
|
|
154
|
+
* Redact a value, returning the SAME reference when nothing in it changed —
|
|
155
|
+
* most lines carry clean meta, and copying every one would put an allocation
|
|
156
|
+
* per log line on hub-main's event loop.
|
|
157
|
+
*/
|
|
158
|
+
function redactValue(value, depth, budget, seen) {
|
|
159
|
+
if (budget.nodes++ > MAX_NODES) return value;
|
|
160
|
+
if (typeof value === "string") return redactLogText(value);
|
|
161
|
+
if (value === null || typeof value !== "object") return value;
|
|
162
|
+
if (depth >= MAX_DEPTH || seen.has(value)) return value;
|
|
163
|
+
if (value instanceof Error) {
|
|
164
|
+
const message = redactLogText(value.message);
|
|
165
|
+
return message === value.message ? value : message;
|
|
166
|
+
}
|
|
167
|
+
if (value instanceof Date || ArrayBuffer.isView(value) || value instanceof ArrayBuffer) return value;
|
|
168
|
+
seen.add(value);
|
|
169
|
+
if (Array.isArray(value)) {
|
|
170
|
+
let copy = null;
|
|
171
|
+
for (let i = 0; i < value.length; i++) {
|
|
172
|
+
const item = value[i];
|
|
173
|
+
const next = redactValue(item, depth + 1, budget, seen);
|
|
174
|
+
if (next !== item) {
|
|
175
|
+
copy ??= [...value];
|
|
176
|
+
copy[i] = next;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return copy ?? value;
|
|
180
|
+
}
|
|
181
|
+
let copy = null;
|
|
182
|
+
for (const [key, child] of Object.entries(value)) {
|
|
183
|
+
const next = typeof child === "string" && child.length > 0 && isCredentialKeyName(key) ? REDACTED : redactValue(child, depth + 1, budget, seen);
|
|
184
|
+
if (next !== child) {
|
|
185
|
+
copy ??= { ...value };
|
|
186
|
+
copy[key] = next;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return copy ?? value;
|
|
190
|
+
}
|
|
191
|
+
/** Redact a `meta` record; the same object back when it was already clean. */
|
|
192
|
+
function redactLogMeta(meta) {
|
|
193
|
+
const out = redactValue(meta, 0, { nodes: 0 }, /* @__PURE__ */ new WeakSet());
|
|
194
|
+
if (out === meta) return meta;
|
|
195
|
+
return out !== null && typeof out === "object" && !Array.isArray(out) ? Object.fromEntries(Object.entries(out)) : meta;
|
|
196
|
+
}
|
|
197
|
+
/** Redact a whole entry: message and meta. Tags are identifiers, left alone. */
|
|
198
|
+
function redactLogEntry(entry) {
|
|
199
|
+
const message = redactLogText(entry.message);
|
|
200
|
+
const meta = entry.meta !== void 0 ? redactLogMeta(entry.meta) : void 0;
|
|
201
|
+
if (message === entry.message && meta === entry.meta) return entry;
|
|
202
|
+
return {
|
|
203
|
+
...entry,
|
|
204
|
+
message,
|
|
205
|
+
...meta !== void 0 ? { meta } : {}
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
//#endregion
|
|
209
|
+
//#region src/kernel/moleculer/runner-failure-info.ts
|
|
210
|
+
/**
|
|
211
|
+
* What the hub knows about a runner that gave up, read at the moment it
|
|
212
|
+
* gives up: the operator-facing name (from the package manifest on disk) and
|
|
213
|
+
* the real cause (the runner's own last stderr line). Both travel in the
|
|
214
|
+
* `addon.runner-failed` / `addon.runner-refused` payload so every alert and
|
|
215
|
+
* notification built from the event names the same thing, with no lookup.
|
|
216
|
+
*/
|
|
217
|
+
/** Opening words of the breaker's own `addon.crashed` text. It describes the breaker, never the cause. */
|
|
218
|
+
var CRASH_BREAKER_ERROR_PREFIX = "Crash circuit-breaker tripped";
|
|
219
|
+
var MAX_CAUSE_LENGTH = 300;
|
|
220
|
+
var INIT_FAILED = /Init failed for "[^"]*":\s*(.+)$/;
|
|
221
|
+
/** The cause out of one stderr line: the text after `Init failed for "<id>":`, else the line itself. */
|
|
222
|
+
function causeOfStderrLine(line) {
|
|
223
|
+
const trimmed = line.trim();
|
|
224
|
+
if (trimmed.length === 0) return void 0;
|
|
225
|
+
return (INIT_FAILED.exec(trimmed)?.[1] ?? trimmed).slice(0, MAX_CAUSE_LENGTH);
|
|
226
|
+
}
|
|
227
|
+
/** Fold a stderr chunk into the runner's last known cause. An `Init failed` line outranks later noise. */
|
|
228
|
+
function lastCauseAfterChunk(previous, chunk) {
|
|
229
|
+
let cause = previous;
|
|
230
|
+
for (const line of chunk.split("\n")) {
|
|
231
|
+
const text = causeOfStderrLine(line);
|
|
232
|
+
if (text === void 0) continue;
|
|
233
|
+
const fromInit = INIT_FAILED.test(line.trim());
|
|
234
|
+
if (fromInit || cause === void 0 || !cause.fromInit) cause = {
|
|
235
|
+
text: redactLogText(text),
|
|
236
|
+
fromInit
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
return cause;
|
|
240
|
+
}
|
|
241
|
+
/** Manifest display name of the runner: the addon whose id is the runner's, else the only addon hosted. */
|
|
242
|
+
function readRunnerDisplayName(addonDirs, runnerId) {
|
|
243
|
+
const names = [];
|
|
244
|
+
for (const dir of addonDirs) try {
|
|
245
|
+
const raw = JSON.parse(fs$1.readFileSync(path$1.join(dir, "package.json"), "utf-8"));
|
|
246
|
+
const camstack = typeof raw === "object" && raw !== null ? Reflect.get(raw, "camstack") : null;
|
|
247
|
+
const addons = typeof camstack === "object" && camstack !== null ? Reflect.get(camstack, "addons") : null;
|
|
248
|
+
if (!Array.isArray(addons)) continue;
|
|
249
|
+
for (const entry of addons) {
|
|
250
|
+
const id = typeof entry === "object" && entry !== null ? Reflect.get(entry, "id") : null;
|
|
251
|
+
const name = typeof entry === "object" && entry !== null ? Reflect.get(entry, "name") : null;
|
|
252
|
+
if (typeof id === "string" && typeof name === "string" && name.trim().length > 0) names.push({
|
|
253
|
+
id,
|
|
254
|
+
name: name.trim()
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
} catch {}
|
|
258
|
+
return names.find((n) => n.id === runnerId)?.name ?? (names.length === 1 ? names[0]?.name : void 0);
|
|
259
|
+
}
|
|
260
|
+
//#endregion
|
|
112
261
|
//#region src/builtins/alerts/runner-alert.ts
|
|
113
262
|
var RUNNER_ALERT_CATEGORIES = [
|
|
114
263
|
"process.crashed",
|
|
@@ -151,10 +300,13 @@ function foldRunnerEvent(previous, category, data, key, now) {
|
|
|
151
300
|
addonIds: []
|
|
152
301
|
};
|
|
153
302
|
const addonIds = [...new Set([...base.addonIds, ...strList(data, "addonIds")])];
|
|
303
|
+
const displayName = base.displayName ?? str(data, "displayName");
|
|
304
|
+
const named = displayName !== void 0 ? { displayName } : {};
|
|
154
305
|
const count = base.count + 1;
|
|
155
306
|
switch (category) {
|
|
156
307
|
case "addon.runner-refused": return {
|
|
157
308
|
...base,
|
|
309
|
+
...named,
|
|
158
310
|
state: "refused",
|
|
159
311
|
count,
|
|
160
312
|
addonIds,
|
|
@@ -164,15 +316,23 @@ function foldRunnerEvent(previous, category, data, key, now) {
|
|
|
164
316
|
case "addon.runner-failed": {
|
|
165
317
|
if (base.state === "refused") return {
|
|
166
318
|
...base,
|
|
319
|
+
...named,
|
|
167
320
|
count,
|
|
168
321
|
addonIds
|
|
169
322
|
};
|
|
170
323
|
const crashes = data["crashesInWindow"];
|
|
324
|
+
const cause = str(data, "lastError");
|
|
325
|
+
const exitCode = data["exitCode"];
|
|
326
|
+
const signal = str(data, "signal");
|
|
171
327
|
return {
|
|
172
328
|
...base,
|
|
329
|
+
...named,
|
|
173
330
|
state: "failed",
|
|
174
331
|
count,
|
|
175
332
|
addonIds,
|
|
333
|
+
...cause !== void 0 ? { lastError: cause } : {},
|
|
334
|
+
...typeof exitCode === "number" ? { exitCode } : {},
|
|
335
|
+
...signal !== void 0 ? { signal } : {},
|
|
176
336
|
...typeof crashes === "number" ? { crashesInWindow: crashes } : {}
|
|
177
337
|
};
|
|
178
338
|
}
|
|
@@ -181,35 +341,55 @@ function foldRunnerEvent(previous, category, data, key, now) {
|
|
|
181
341
|
const addonId = str(data, "addonId");
|
|
182
342
|
return {
|
|
183
343
|
...base,
|
|
344
|
+
...named,
|
|
184
345
|
count,
|
|
185
346
|
addonIds: addonId !== void 0 ? [...new Set([...addonIds, addonId])] : addonIds,
|
|
186
|
-
...error !== void 0 ? { lastError: error } : {}
|
|
347
|
+
...error !== void 0 && !error.startsWith("Crash circuit-breaker tripped") ? { lastError: error } : {}
|
|
187
348
|
};
|
|
188
349
|
}
|
|
189
350
|
case "process.crashed": return {
|
|
190
351
|
...base,
|
|
352
|
+
...named,
|
|
191
353
|
count,
|
|
192
354
|
addonIds
|
|
193
355
|
};
|
|
194
356
|
}
|
|
195
357
|
}
|
|
358
|
+
/** `Core block "TV" (core-block-x)`, `Addon "Reolink" (reolink)`; the bare id when no name is known. */
|
|
359
|
+
function runnerLabel(record) {
|
|
360
|
+
const { displayName, runnerId } = record;
|
|
361
|
+
if (displayName === void 0) return `"${runnerId}"`;
|
|
362
|
+
return `${runnerId.startsWith("core-block-") ? "Core block" : "Addon"} "${displayName}" (${runnerId})`;
|
|
363
|
+
}
|
|
364
|
+
/** `: <cause>`; with no cause known, how the process left (`: exit code 1`), else nothing. */
|
|
365
|
+
function failureCause(record) {
|
|
366
|
+
if (record.lastError !== void 0) return `: ${record.lastError}`;
|
|
367
|
+
if (record.signal !== void 0) return `: killed by ${record.signal}`;
|
|
368
|
+
if (record.exitCode !== void 0) return `: exit code ${String(record.exitCode)}`;
|
|
369
|
+
return "";
|
|
370
|
+
}
|
|
196
371
|
function renderRunnerAlert(record) {
|
|
197
|
-
const
|
|
372
|
+
const named = record.displayName !== void 0;
|
|
373
|
+
const on = record.nodeId === "hub" ? "" : ` on ${record.nodeId}`;
|
|
374
|
+
const label = `${runnerLabel(record)}${on}`;
|
|
198
375
|
switch (record.state) {
|
|
199
376
|
case "refused": return {
|
|
200
377
|
severity: "critical",
|
|
201
378
|
title: "Addon refused to start",
|
|
202
|
-
message: `${
|
|
203
|
-
};
|
|
204
|
-
case "failed": return {
|
|
205
|
-
severity: "critical",
|
|
206
|
-
title: "Addon crash loop",
|
|
207
|
-
message: `Runner "${where}" gave up${record.crashesInWindow !== void 0 ? ` after ${String(record.crashesInWindow)} crashes` : ""}${record.addonIds.length > 0 ? ` (addons: ${record.addonIds.join(", ")})` : ""} - ${String(record.count)} events`
|
|
379
|
+
message: `${named ? label : `${record.runnerId}${on}`}: refused - ${record.reason ?? "no reason reported"}${record.remedy !== void 0 ? ` ${record.remedy}` : ""}`
|
|
208
380
|
};
|
|
381
|
+
case "failed": {
|
|
382
|
+
const others = record.addonIds.filter((id) => id !== record.runnerId);
|
|
383
|
+
return {
|
|
384
|
+
severity: "critical",
|
|
385
|
+
title: "Addon crash loop",
|
|
386
|
+
message: `${named ? label : `Runner ${label}`} gave up${record.crashesInWindow !== void 0 ? ` after ${String(record.crashesInWindow)} crashes` : ""}${failureCause(record)}${others.length > 0 ? ` (addons: ${others.join(", ")})` : ""} - ${String(record.count)} events`
|
|
387
|
+
};
|
|
388
|
+
}
|
|
209
389
|
case "crashed": return {
|
|
210
390
|
severity: "error",
|
|
211
391
|
title: "Addon crashed",
|
|
212
|
-
message: `Addon
|
|
392
|
+
message: `${named ? label : `Addon ${label}`} crashed${record.lastError !== void 0 ? `: ${record.lastError}` : ""}${record.count > 1 ? ` (${String(record.count)} events)` : ""}`
|
|
213
393
|
};
|
|
214
394
|
}
|
|
215
395
|
}
|
|
@@ -440,7 +620,7 @@ function planMigrationAlerts(ledger, open, now) {
|
|
|
440
620
|
faultedIds.add(id);
|
|
441
621
|
raise.push({
|
|
442
622
|
id,
|
|
443
|
-
category: EventCategory.MigrationFailed,
|
|
623
|
+
category: EventCategory$1.MigrationFailed,
|
|
444
624
|
severity,
|
|
445
625
|
title: entry.status === "skipped-newer" ? "Database is newer than this version" : "Migration failed",
|
|
446
626
|
message: messageOf(entry),
|
|
@@ -668,6 +848,9 @@ function parseRunnerRecord(value) {
|
|
|
668
848
|
since: typeof rec["since"] === "number" ? rec["since"] : 0,
|
|
669
849
|
count: rec["count"],
|
|
670
850
|
addonIds: rec["addonIds"].filter((x) => typeof x === "string"),
|
|
851
|
+
...typeof rec["displayName"] === "string" ? { displayName: rec["displayName"] } : {},
|
|
852
|
+
...typeof rec["exitCode"] === "number" ? { exitCode: rec["exitCode"] } : {},
|
|
853
|
+
...typeof rec["signal"] === "string" ? { signal: rec["signal"] } : {},
|
|
671
854
|
...typeof rec["lastError"] === "string" ? { lastError: rec["lastError"] } : {},
|
|
672
855
|
...typeof rec["reason"] === "string" ? { reason: rec["reason"] } : {},
|
|
673
856
|
...typeof rec["remedy"] === "string" ? { remedy: rec["remedy"] } : {},
|
|
@@ -681,6 +864,8 @@ function parseAlert(record) {
|
|
|
681
864
|
...record.data
|
|
682
865
|
});
|
|
683
866
|
}
|
|
867
|
+
/** Upper bound on the name lookup of a runner alert; past it the alert names the id. */
|
|
868
|
+
var RUNNER_NAME_LOOKUP_MS = 1500;
|
|
684
869
|
var DEFAULT_CONFIG = {
|
|
685
870
|
maxAlerts: 500,
|
|
686
871
|
retentionDays: 30
|
|
@@ -874,55 +1059,55 @@ var AlertCenterAddon = class extends BaseAddon {
|
|
|
874
1059
|
await this.handleRunnerEvent(category, event);
|
|
875
1060
|
return;
|
|
876
1061
|
}
|
|
877
|
-
if (category === EventCategory.ProcessStateChanged) {
|
|
1062
|
+
if (category === EventCategory$1.ProcessStateChanged) {
|
|
878
1063
|
await this.handleRunnerStateChanged(event);
|
|
879
1064
|
return;
|
|
880
1065
|
}
|
|
881
|
-
if (category === EventCategory.SystemRunnerCheck) {
|
|
1066
|
+
if (category === EventCategory$1.SystemRunnerCheck) {
|
|
882
1067
|
await this.handleRunnerCheck(event);
|
|
883
1068
|
return;
|
|
884
1069
|
}
|
|
885
|
-
if (category === EventCategory.AddonLoadFailed) {
|
|
1070
|
+
if (category === EventCategory$1.AddonLoadFailed) {
|
|
886
1071
|
await this.handleAddonLoadFailed(event);
|
|
887
1072
|
return;
|
|
888
1073
|
}
|
|
889
|
-
if (category === EventCategory.AddonLoadRecovered) {
|
|
1074
|
+
if (category === EventCategory$1.AddonLoadRecovered) {
|
|
890
1075
|
await this.handleAddonLoadRecovered(event);
|
|
891
1076
|
return;
|
|
892
1077
|
}
|
|
893
|
-
if (category === EventCategory.SystemLivenessFailed) {
|
|
1078
|
+
if (category === EventCategory$1.SystemLivenessFailed) {
|
|
894
1079
|
await this.handleLivenessFailed(event);
|
|
895
1080
|
return;
|
|
896
1081
|
}
|
|
897
|
-
if (category === EventCategory.SystemLivenessRecovered) {
|
|
1082
|
+
if (category === EventCategory$1.SystemLivenessRecovered) {
|
|
898
1083
|
await this.handleLivenessRecovered(event);
|
|
899
1084
|
return;
|
|
900
1085
|
}
|
|
901
|
-
if (category === EventCategory.StreamOffline) {
|
|
1086
|
+
if (category === EventCategory$1.StreamOffline) {
|
|
902
1087
|
await this.handleStreamOffline(event);
|
|
903
1088
|
return;
|
|
904
1089
|
}
|
|
905
|
-
if (category === EventCategory.StreamOnline) {
|
|
1090
|
+
if (category === EventCategory$1.StreamOnline) {
|
|
906
1091
|
await this.handleStreamOnline(event);
|
|
907
1092
|
return;
|
|
908
1093
|
}
|
|
909
|
-
if (category === EventCategory.MigrationFailed || category === EventCategory.MigrationApplied) {
|
|
1094
|
+
if (category === EventCategory$1.MigrationFailed || category === EventCategory$1.MigrationApplied) {
|
|
910
1095
|
await this.reconcileMigrationAlerts();
|
|
911
1096
|
return;
|
|
912
1097
|
}
|
|
913
|
-
if (category === EventCategory.NotificationRuleBroken) {
|
|
1098
|
+
if (category === EventCategory$1.NotificationRuleBroken) {
|
|
914
1099
|
await this.handleRuleBroken(event);
|
|
915
1100
|
return;
|
|
916
1101
|
}
|
|
917
|
-
if (category === EventCategory.NotificationRuleRepaired) {
|
|
1102
|
+
if (category === EventCategory$1.NotificationRuleRepaired) {
|
|
918
1103
|
await this.handleRuleRepaired(event);
|
|
919
1104
|
return;
|
|
920
1105
|
}
|
|
921
|
-
if (category === EventCategory.AgentOnline) {
|
|
1106
|
+
if (category === EventCategory$1.AgentOnline) {
|
|
922
1107
|
await this.reconcileClusterAlerts();
|
|
923
1108
|
return;
|
|
924
1109
|
}
|
|
925
|
-
if (category === EventCategory.SystemRestartCompleted) {
|
|
1110
|
+
if (category === EventCategory$1.SystemRestartCompleted) {
|
|
926
1111
|
this.noteRestartCompleted(event);
|
|
927
1112
|
await this.reconcileClusterAlerts();
|
|
928
1113
|
}
|
|
@@ -956,7 +1141,7 @@ var AlertCenterAddon = class extends BaseAddon {
|
|
|
956
1141
|
} catch (err) {
|
|
957
1142
|
this.ctx.logger?.warn("Failed to handle event", { meta: {
|
|
958
1143
|
category,
|
|
959
|
-
error: errMsg(err)
|
|
1144
|
+
error: errMsg$1(err)
|
|
960
1145
|
} });
|
|
961
1146
|
}
|
|
962
1147
|
}
|
|
@@ -981,7 +1166,12 @@ var AlertCenterAddon = class extends BaseAddon {
|
|
|
981
1166
|
if (key === null) return;
|
|
982
1167
|
const alertId = runnerAlertId(key.nodeId, key.runnerId);
|
|
983
1168
|
const previous = await this.readRunnerRecord(alertId);
|
|
984
|
-
const
|
|
1169
|
+
const folded = foldRunnerEvent(previous, category, event.data, key, Date.now());
|
|
1170
|
+
const displayName = folded.displayName ?? await this.resolveRunnerName(key.runnerId, folded.addonIds);
|
|
1171
|
+
const record = displayName === void 0 ? folded : {
|
|
1172
|
+
...folded,
|
|
1173
|
+
displayName
|
|
1174
|
+
};
|
|
985
1175
|
const rendered = renderRunnerAlert(record);
|
|
986
1176
|
const existing = await this.readAlertRaw(alertId);
|
|
987
1177
|
const now = Date.now();
|
|
@@ -1179,7 +1369,7 @@ var AlertCenterAddon = class extends BaseAddon {
|
|
|
1179
1369
|
} else {
|
|
1180
1370
|
const alert = {
|
|
1181
1371
|
id: stableId,
|
|
1182
|
-
category: EventCategory.ModelDownloadProgress,
|
|
1372
|
+
category: EventCategory$1.ModelDownloadProgress,
|
|
1183
1373
|
severity: "info",
|
|
1184
1374
|
title: "Model download",
|
|
1185
1375
|
message: `Downloading model "${modelId}" — ${String(Math.round(progress))}%`,
|
|
@@ -1261,7 +1451,7 @@ var AlertCenterAddon = class extends BaseAddon {
|
|
|
1261
1451
|
const message = errorObj?.message ? `${addonId ? `${addonId} — ` : ""}${errorObj.message}` : `Addon ${addonId ?? packageName} failed to load`;
|
|
1262
1452
|
const alert = {
|
|
1263
1453
|
id: stableId,
|
|
1264
|
-
category: EventCategory.AddonLoadFailed,
|
|
1454
|
+
category: EventCategory$1.AddonLoadFailed,
|
|
1265
1455
|
severity: "error",
|
|
1266
1456
|
title: `Addon failed: ${addonId ?? packageName}`,
|
|
1267
1457
|
message,
|
|
@@ -1297,7 +1487,7 @@ var AlertCenterAddon = class extends BaseAddon {
|
|
|
1297
1487
|
} catch (err) {
|
|
1298
1488
|
this.ctx.logger?.debug("AddonLoadRecovered: dismiss failed (likely already dismissed)", { meta: {
|
|
1299
1489
|
stableId,
|
|
1300
|
-
error: errMsg(err)
|
|
1490
|
+
error: errMsg$1(err)
|
|
1301
1491
|
} });
|
|
1302
1492
|
}
|
|
1303
1493
|
}
|
|
@@ -1318,7 +1508,7 @@ var AlertCenterAddon = class extends BaseAddon {
|
|
|
1318
1508
|
const actionLabel = typeof data["actionLabel"] === "string" ? data["actionLabel"] : "Open";
|
|
1319
1509
|
const alert = {
|
|
1320
1510
|
id: findingId,
|
|
1321
|
-
category: EventCategory.SystemLivenessFailed,
|
|
1511
|
+
category: EventCategory$1.SystemLivenessFailed,
|
|
1322
1512
|
severity,
|
|
1323
1513
|
title: String(data["title"] ?? "Node liveness"),
|
|
1324
1514
|
message: String(data["message"] ?? ""),
|
|
@@ -1350,7 +1540,7 @@ var AlertCenterAddon = class extends BaseAddon {
|
|
|
1350
1540
|
} catch (err) {
|
|
1351
1541
|
this.ctx.logger?.debug("LivenessRecovered: dismiss failed (likely already dismissed)", { meta: {
|
|
1352
1542
|
findingId,
|
|
1353
|
-
error: errMsg(err)
|
|
1543
|
+
error: errMsg$1(err)
|
|
1354
1544
|
} });
|
|
1355
1545
|
}
|
|
1356
1546
|
}
|
|
@@ -1371,7 +1561,7 @@ var AlertCenterAddon = class extends BaseAddon {
|
|
|
1371
1561
|
const label = name ?? `Camera ${String(deviceId)}`;
|
|
1372
1562
|
const alert = {
|
|
1373
1563
|
id: `stream-offline:${String(deviceId)}`,
|
|
1374
|
-
category: EventCategory.StreamOffline,
|
|
1564
|
+
category: EventCategory$1.StreamOffline,
|
|
1375
1565
|
severity: "warning",
|
|
1376
1566
|
title: "Stream offline",
|
|
1377
1567
|
message: `${label} — ${camStreamIds.length > 0 ? camStreamIds.join(", ") : "its stream"} stopped sending video (${reason}).`,
|
|
@@ -1407,7 +1597,7 @@ var AlertCenterAddon = class extends BaseAddon {
|
|
|
1407
1597
|
const what = reason === "unparseable" ? "cannot be loaded and sends nothing — open it and save it again" : reason === "device-deleted" ? `still names a deleted device (${offendingIds.join(", ")}) and was switched off` : reason === "target-deleted" ? `still sends to a deleted destination (${offendingIds.join(", ")}) and was switched off` : "cannot work";
|
|
1408
1598
|
const alert = {
|
|
1409
1599
|
id: `nc-rule-broken:${ruleId}`,
|
|
1410
|
-
category: EventCategory.NotificationRuleBroken,
|
|
1600
|
+
category: EventCategory$1.NotificationRuleBroken,
|
|
1411
1601
|
severity: "warning",
|
|
1412
1602
|
title: "Notification rule broken",
|
|
1413
1603
|
message: `Rule "${ruleName}" ${what}.`,
|
|
@@ -1460,14 +1650,14 @@ var AlertCenterAddon = class extends BaseAddon {
|
|
|
1460
1650
|
if (ids.length === 0) return;
|
|
1461
1651
|
this.ctx.logger?.info("cluster alerts resolved from the node list", { meta: { count: ids.length } });
|
|
1462
1652
|
} catch (err) {
|
|
1463
|
-
this.ctx.logger?.warn("cluster alerts: reconcile failed", { meta: { error: errMsg(err) } });
|
|
1653
|
+
this.ctx.logger?.warn("cluster alerts: reconcile failed", { meta: { error: errMsg$1(err) } });
|
|
1464
1654
|
}
|
|
1465
1655
|
}
|
|
1466
1656
|
async readClusterNodes() {
|
|
1467
1657
|
try {
|
|
1468
1658
|
return (await this.ctx.api.nodes.directory.query()).nodes;
|
|
1469
1659
|
} catch (err) {
|
|
1470
|
-
this.ctx.logger?.warn("cluster alerts: reconcile skipped, the node list could not be read", { meta: { error: errMsg(err) } });
|
|
1660
|
+
this.ctx.logger?.warn("cluster alerts: reconcile skipped, the node list could not be read", { meta: { error: errMsg$1(err) } });
|
|
1471
1661
|
return null;
|
|
1472
1662
|
}
|
|
1473
1663
|
}
|
|
@@ -1483,7 +1673,7 @@ var AlertCenterAddon = class extends BaseAddon {
|
|
|
1483
1673
|
for (const alert of plan.raise) await this.emitAlert(alert);
|
|
1484
1674
|
for (const alertId of plan.dismiss) await this.dismiss(alertId);
|
|
1485
1675
|
} catch (err) {
|
|
1486
|
-
this.ctx.logger.warn("migration alerts: reconcile skipped, the ledger could not be read", { meta: { error: errMsg(err) } });
|
|
1676
|
+
this.ctx.logger.warn("migration alerts: reconcile skipped, the ledger could not be read", { meta: { error: errMsg$1(err) } });
|
|
1487
1677
|
}
|
|
1488
1678
|
}
|
|
1489
1679
|
/** The rule works again — drop its broken-rule card. */
|
|
@@ -1496,7 +1686,7 @@ var AlertCenterAddon = class extends BaseAddon {
|
|
|
1496
1686
|
} catch (err) {
|
|
1497
1687
|
this.ctx.logger?.debug("NotificationRuleRepaired: dismiss failed (likely already dismissed)", { meta: {
|
|
1498
1688
|
stableId,
|
|
1499
|
-
error: errMsg(err)
|
|
1689
|
+
error: errMsg$1(err)
|
|
1500
1690
|
} });
|
|
1501
1691
|
}
|
|
1502
1692
|
}
|
|
@@ -1511,7 +1701,7 @@ var AlertCenterAddon = class extends BaseAddon {
|
|
|
1511
1701
|
} catch (err) {
|
|
1512
1702
|
this.ctx.logger?.debug("StreamOnline: dismiss failed (likely already dismissed)", { meta: {
|
|
1513
1703
|
stableId,
|
|
1514
|
-
error: errMsg(err)
|
|
1704
|
+
error: errMsg$1(err)
|
|
1515
1705
|
} });
|
|
1516
1706
|
}
|
|
1517
1707
|
}
|
|
@@ -1525,7 +1715,37 @@ var AlertCenterAddon = class extends BaseAddon {
|
|
|
1525
1715
|
const pattern = deviceId === void 0 ? /^stream-offline:\d+:.+/ : new RegExp(`^stream-offline:${String(deviceId)}:.+`);
|
|
1526
1716
|
for (const alert of await this.listAlerts({ limit: 1e3 })) if (alert.status === "active" && pattern.test(alert.id)) await this.dismiss(alert.id);
|
|
1527
1717
|
} catch (err) {
|
|
1528
|
-
this.ctx.logger?.debug("legacy stream cards: sweep failed", { meta: { error: errMsg(err) } });
|
|
1718
|
+
this.ctx.logger?.debug("legacy stream cards: sweep failed", { meta: { error: errMsg$1(err) } });
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
/**
|
|
1722
|
+
* The operator-facing name of a runner: a core block's `name`, an addon's
|
|
1723
|
+
* manifest name. Bounded and never throwing - the alert must go out with the
|
|
1724
|
+
* id when the lookup is slow or fails (D49).
|
|
1725
|
+
*/
|
|
1726
|
+
async resolveRunnerName(runnerId, addonIds) {
|
|
1727
|
+
const lookup = async () => {
|
|
1728
|
+
if (runnerId.startsWith("core-block-")) {
|
|
1729
|
+
const { block } = await this.ctx.api.coreBlocks.get.query({ blockId: runnerId.slice(CORE_BLOCK_ADDON_PREFIX.length) });
|
|
1730
|
+
return block?.name;
|
|
1731
|
+
}
|
|
1732
|
+
const hosted = addonIds.length === 1 ? addonIds[0] : void 0;
|
|
1733
|
+
return (await this.ctx.api.addons.list.query()).find((i) => i.manifest.id === runnerId || i.manifest.id === hosted)?.manifest.name;
|
|
1734
|
+
};
|
|
1735
|
+
let timer;
|
|
1736
|
+
try {
|
|
1737
|
+
const trimmed = (await Promise.race([lookup(), new Promise((resolve) => {
|
|
1738
|
+
timer = setTimeout(() => resolve(void 0), RUNNER_NAME_LOOKUP_MS);
|
|
1739
|
+
})]))?.trim();
|
|
1740
|
+
return trimmed !== void 0 && trimmed.length > 0 ? trimmed : void 0;
|
|
1741
|
+
} catch (err) {
|
|
1742
|
+
this.ctx.logger?.debug("resolveRunnerName failed, showing the runner id", { meta: {
|
|
1743
|
+
runnerId,
|
|
1744
|
+
error: errMsg$1(err)
|
|
1745
|
+
} });
|
|
1746
|
+
return;
|
|
1747
|
+
} finally {
|
|
1748
|
+
if (timer !== void 0) clearTimeout(timer);
|
|
1529
1749
|
}
|
|
1530
1750
|
}
|
|
1531
1751
|
async resolveDeviceName(deviceId) {
|
|
@@ -1535,7 +1755,7 @@ var AlertCenterAddon = class extends BaseAddon {
|
|
|
1535
1755
|
} catch (err) {
|
|
1536
1756
|
this.ctx.logger?.debug("resolveDeviceName failed", {
|
|
1537
1757
|
tags: { deviceId },
|
|
1538
|
-
meta: { error: errMsg(err) }
|
|
1758
|
+
meta: { error: errMsg$1(err) }
|
|
1539
1759
|
});
|
|
1540
1760
|
}
|
|
1541
1761
|
}
|
|
@@ -1545,12 +1765,6 @@ var AlertCenterAddon = class extends BaseAddon {
|
|
|
1545
1765
|
const error = data.error;
|
|
1546
1766
|
const processId = data.processId;
|
|
1547
1767
|
switch (category) {
|
|
1548
|
-
case "addon.crashed": return `Addon "${addonId ?? "unknown"}" crashed${error ? `: ${error}` : ""}`;
|
|
1549
|
-
case "addon.runner-failed": {
|
|
1550
|
-
const runnerId = typeof data.runnerId === "string" ? data.runnerId : "unknown";
|
|
1551
|
-
const addonIds = Array.isArray(data.addonIds) ? data.addonIds.filter((x) => typeof x === "string").join(", ") : "";
|
|
1552
|
-
return `Runner "${runnerId}" gave up${addonIds.length > 0 ? ` (addons: ${addonIds})` : ""}`;
|
|
1553
|
-
}
|
|
1554
1768
|
case "addon.error": return `Addon "${addonId ?? "unknown"}" error${error ? `: ${error}` : ""}`;
|
|
1555
1769
|
case "addon.installed": return `Addon "${addonId ?? "unknown"}" installed`;
|
|
1556
1770
|
case "addon.updated": {
|
|
@@ -1678,10 +1892,10 @@ var AlertCenterAddon = class extends BaseAddon {
|
|
|
1678
1892
|
announceEpisode(previous, alert) {
|
|
1679
1893
|
const edge = episodeEdge(previous, episodeViewOf(alert));
|
|
1680
1894
|
if (edge === null) return;
|
|
1681
|
-
this.ctx.eventBus?.emit(createEvent(EventCategory.AlertEpisode, EVENT_SOURCE, alertEpisodePayload(alert, edge, Date.now())));
|
|
1895
|
+
this.ctx.eventBus?.emit(createEvent$1(EventCategory$1.AlertEpisode, EVENT_SOURCE, alertEpisodePayload(alert, edge, Date.now())));
|
|
1682
1896
|
}
|
|
1683
1897
|
emitAlertCreatedEvent(alert) {
|
|
1684
|
-
this.ctx.eventBus?.emit(createEvent("alert.created", EVENT_SOURCE, {
|
|
1898
|
+
this.ctx.eventBus?.emit(createEvent$1("alert.created", EVENT_SOURCE, {
|
|
1685
1899
|
id: alert.id,
|
|
1686
1900
|
category: alert.category,
|
|
1687
1901
|
severity: alert.severity,
|
|
@@ -1692,7 +1906,7 @@ var AlertCenterAddon = class extends BaseAddon {
|
|
|
1692
1906
|
emitAlertUpdatedEvent(alertId, patch) {
|
|
1693
1907
|
const patchRecord = {};
|
|
1694
1908
|
for (const [key, value] of Object.entries(patch)) patchRecord[key] = value;
|
|
1695
|
-
this.ctx.eventBus?.emit(createEvent("alert.updated", EVENT_SOURCE, {
|
|
1909
|
+
this.ctx.eventBus?.emit(createEvent$1("alert.updated", EVENT_SOURCE, {
|
|
1696
1910
|
alertId,
|
|
1697
1911
|
patch: patchRecord
|
|
1698
1912
|
}));
|
|
@@ -1713,4 +1927,4 @@ var AlertCenterAddon = class extends BaseAddon {
|
|
|
1713
1927
|
}
|
|
1714
1928
|
};
|
|
1715
1929
|
//#endregion
|
|
1716
|
-
export { AlertCenterAddon, AlertCenterAddon as default };
|
|
1930
|
+
export { AlertCenterAddon, AlertCenterAddon as default, redactLogEntry as a, isCredentialKeyName as i, lastCauseAfterChunk as n, redactLogMeta as o, readRunnerDisplayName as r, redactLogText as s, CRASH_BREAKER_ERROR_PREFIX as t };
|
|
@@ -24,13 +24,18 @@ export interface RunnerAlertRecord {
|
|
|
24
24
|
/** Events folded into this record. */
|
|
25
25
|
readonly count: number;
|
|
26
26
|
readonly addonIds: readonly string[];
|
|
27
|
-
/**
|
|
27
|
+
/** Human name of the runner (a core block's name, an addon's manifest name); absent = unknown, the id is shown. */
|
|
28
|
+
readonly displayName?: string;
|
|
29
|
+
/** The real cause: the runner's own last stderr line, else a crash event's error (never the breaker's own text). */
|
|
28
30
|
readonly lastError?: string;
|
|
29
31
|
/** Refusal: the addon's own words, and what the operator does. */
|
|
30
32
|
readonly reason?: string;
|
|
31
33
|
readonly remedy?: string;
|
|
32
34
|
/** Breaker: crashes inside the window. */
|
|
33
35
|
readonly crashesInWindow?: number;
|
|
36
|
+
/** How the last process left, when the hub saw it. */
|
|
37
|
+
readonly exitCode?: number;
|
|
38
|
+
readonly signal?: string;
|
|
34
39
|
}
|
|
35
40
|
export type RunnerAlertCategory = "process.crashed" | "addon.crashed" | "addon.runner-failed" | "addon.runner-refused";
|
|
36
41
|
export declare const RUNNER_ALERT_CATEGORIES: readonly RunnerAlertCategory[];
|
|
@@ -5,14 +5,14 @@ Object.defineProperties(exports, {
|
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
6
|
const require_dist = require("../../dist-CA672buZ.js");
|
|
7
7
|
const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
|
|
8
|
-
const require_restore_archive = require("../../restore-archive-
|
|
8
|
+
const require_restore_archive = require("../../restore-archive-BCXQaw89.js");
|
|
9
9
|
let node_crypto = require("node:crypto");
|
|
10
|
-
let node_fs_promises = require("node:fs/promises");
|
|
11
|
-
node_fs_promises = require_chunk.__toESM(node_fs_promises);
|
|
12
|
-
let node_path = require("node:path");
|
|
13
|
-
node_path = require_chunk.__toESM(node_path);
|
|
14
10
|
let node_fs = require("node:fs");
|
|
15
11
|
node_fs = require_chunk.__toESM(node_fs);
|
|
12
|
+
let node_path = require("node:path");
|
|
13
|
+
node_path = require_chunk.__toESM(node_path);
|
|
14
|
+
let node_fs_promises = require("node:fs/promises");
|
|
15
|
+
node_fs_promises = require_chunk.__toESM(node_fs_promises);
|
|
16
16
|
//#region src/builtins/backup-orchestrator/backup-databases.ts
|
|
17
17
|
/** Stable id of the seeded weekly schedule. */
|
|
18
18
|
var WEEKLY_SCHEDULE_ID = "weekly-events-history";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Ao as BaseAddon, Da as storageOccupancyCapability, _c as EventCategory, cc as toNodeId, di as mayWriteToLocation, qs as nodePin, yn as backupCapability } from "../../dist-W0Eyg7Fm.mjs";
|
|
2
2
|
import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
|
|
3
|
-
import { _ as backupRecordStoresOf, a as BackupSnapshotRefusedError, d as ENCRYPTED_BACKUP_SUFFIX, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, i as BackupCancelledError, l as BackupKeyFormatError, m as parseBackupSecretKey, n as precheckRestoreKey, o as DEFAULT_BACKUP_DATABASES, p as parseBackupPublicKey, r as prepareRestoreArchive, s as SystemBackupService } from "../../restore-archive-
|
|
3
|
+
import { _ as backupRecordStoresOf, a as BackupSnapshotRefusedError, d as ENCRYPTED_BACKUP_SUFFIX, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, i as BackupCancelledError, l as BackupKeyFormatError, m as parseBackupSecretKey, n as precheckRestoreKey, o as DEFAULT_BACKUP_DATABASES, p as parseBackupPublicKey, r as prepareRestoreArchive, s as SystemBackupService } from "../../restore-archive-B2l00XlI.mjs";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
|
-
import * as fsp from "node:fs/promises";
|
|
6
|
-
import * as path$1 from "node:path";
|
|
7
5
|
import * as fs$1 from "node:fs";
|
|
6
|
+
import * as path$1 from "node:path";
|
|
7
|
+
import * as fsp from "node:fs/promises";
|
|
8
8
|
//#region src/builtins/backup-orchestrator/backup-databases.ts
|
|
9
9
|
/** Stable id of the seeded weekly schedule. */
|
|
10
10
|
var WEEKLY_SCHEDULE_ID = "weekly-events-history";
|
|
@@ -6,8 +6,8 @@ require("../../chunk-Cek0wNdY.js");
|
|
|
6
6
|
const require_dist = require("../../dist-CA672buZ.js");
|
|
7
7
|
let zod = require("zod");
|
|
8
8
|
let _camstack_types_node = require("@camstack/types/node");
|
|
9
|
-
let node_path = require("node:path");
|
|
10
9
|
let node_fs = require("node:fs");
|
|
10
|
+
let node_path = require("node:path");
|
|
11
11
|
let node_child_process = require("node:child_process");
|
|
12
12
|
let node_http = require("node:http");
|
|
13
13
|
//#region src/builtins/camera-grid/grid-camera-declarations.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Ao as BaseAddon, Ct as MOTION_CLOSE_AFTER_MS, K as DeclaredDevices, L as DERIVED_CAMERA_SILENCED_CAP_NAMES, Ns as hydrateSchema, Sa as snapshotCapability, _c as EventCategory, ao as buildFfmpegArgs, bn as bareAddonId, bs as createEvent, er as declarationOwnerNodeId, gc as errMsg, hc as DeviceType, ka as streamCatalogCapability, kn as cameraGridLayoutCapability, m as BaseDevice, mi as memoizePinnedFfmpeg, pc as DeviceFeature, yi as motionCapability } from "../../dist-W0Eyg7Fm.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { FfmpegProcess } from "@camstack/types/node";
|
|
4
|
-
import { join } from "node:path";
|
|
5
4
|
import { promises } from "node:fs";
|
|
5
|
+
import { join } from "node:path";
|
|
6
6
|
import { spawn } from "node:child_process";
|
|
7
7
|
import { createServer } from "node:http";
|
|
8
8
|
//#region src/builtins/camera-grid/grid-camera-declarations.ts
|
|
@@ -9,12 +9,12 @@ const require_prefix_walk = require("../../prefix-walk-Dv6MLZlM.js");
|
|
|
9
9
|
let zod = require("zod");
|
|
10
10
|
let node_crypto = require("node:crypto");
|
|
11
11
|
let _camstack_types_node = require("@camstack/types/node");
|
|
12
|
-
let node_fs_promises = require("node:fs/promises");
|
|
13
|
-
node_fs_promises = require_chunk.__toESM(node_fs_promises);
|
|
14
12
|
let node_path = require("node:path");
|
|
15
13
|
node_path = require_chunk.__toESM(node_path);
|
|
16
|
-
let node_util = require("node:util");
|
|
17
14
|
let _camstack_types_addon = require("@camstack/types/addon");
|
|
15
|
+
let node_fs_promises = require("node:fs/promises");
|
|
16
|
+
node_fs_promises = require_chunk.__toESM(node_fs_promises);
|
|
17
|
+
let node_util = require("node:util");
|
|
18
18
|
let node_module = require("node:module");
|
|
19
19
|
let node_os = require("node:os");
|
|
20
20
|
node_os = require_chunk.__toESM(node_os);
|