@camstack/system 1.1.33 → 1.1.35
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 +1 -1
- package/dist/addon-runner.mjs +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +6 -6
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +6 -6
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/dist/builtins/alerts/alerts.addon.js +12 -12
- package/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +5 -5
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
- package/dist/builtins/console-logging/index.js +3 -3
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/device-manager/device-manager.addon.js +69 -69
- package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
- package/dist/builtins/hub-forwarder/index.js +3 -3
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/local-auth/local-auth.addon.js +7 -7
- package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
- package/dist/builtins/local-network/local-network.addon.js +7 -7
- package/dist/builtins/local-network/local-network.addon.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +5 -5
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/dist/builtins/platform-probe/index.js +13 -13
- package/dist/builtins/platform-probe/index.mjs +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +4 -4
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +13 -13
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +4 -4
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +9 -9
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +5 -5
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/dist/builtins/system-config/system-config.addon.js +5 -5
- package/dist/builtins/system-config/system-config.addon.mjs +1 -1
- package/dist/builtins/winston-logging/index.js +3 -3
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/dist-DlGZpWo8.mjs +24597 -0
- package/dist/dist-DriXJoVg.js +25070 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +113 -126
- package/dist/index.mjs +73 -63
- package/dist/{manifest-python-deps-u-AQBQY6.mjs → manifest-python-deps-MUu1e33G.mjs} +27 -27
- package/dist/{manifest-python-deps-CAnO1wPx.js → manifest-python-deps-jZA_Qorz.js} +3 -3
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
3
|
-
|
|
3
|
+
const require_dist = require("../../dist-DriXJoVg.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
|
|
@@ -28,7 +28,7 @@ node_os = require_chunk.__toESM(node_os);
|
|
|
28
28
|
*/
|
|
29
29
|
var MESH_PROVIDER_ADDON_IDS = ["tailscale-client"];
|
|
30
30
|
var POLL_INTERVAL_MS = 3e4;
|
|
31
|
-
var LocalNetworkAddon = class extends
|
|
31
|
+
var LocalNetworkAddon = class extends require_dist.BaseAddon {
|
|
32
32
|
pollTimer = null;
|
|
33
33
|
lastSnapshotKey = "";
|
|
34
34
|
/** Optional public hostname tracked from `NetworkTunnelStarted`/
|
|
@@ -95,15 +95,15 @@ var LocalNetworkAddon = class extends _camstack_types.BaseAddon {
|
|
|
95
95
|
this.lastSnapshotKey = snapshotKey(this.enumerate());
|
|
96
96
|
this.pollTimer = setInterval(() => this.detectChanges(), POLL_INTERVAL_MS);
|
|
97
97
|
this.pollTimer.unref?.();
|
|
98
|
-
this.ctx.eventBus?.subscribe({ category:
|
|
98
|
+
this.ctx.eventBus?.subscribe({ category: require_dist.EventCategory.NetworkTunnelStarted }, (event) => {
|
|
99
99
|
const data = event.data ?? {};
|
|
100
100
|
if (typeof data.url === "string") try {
|
|
101
101
|
const hostname = new URL(data.url).hostname;
|
|
102
102
|
if (hostname && !hostname.endsWith(".placeholder") && !hostname.startsWith("pending.")) this.setPublicHostname(hostname);
|
|
103
103
|
} catch {}
|
|
104
104
|
});
|
|
105
|
-
this.ctx.eventBus?.subscribe({ category:
|
|
106
|
-
this.ctx.eventBus?.subscribe({ category:
|
|
105
|
+
this.ctx.eventBus?.subscribe({ category: require_dist.EventCategory.NetworkTunnelStopped }, () => this.setPublicHostname(""));
|
|
106
|
+
this.ctx.eventBus?.subscribe({ category: require_dist.EventCategory.MeshNetworkChanged }, (event) => {
|
|
107
107
|
const data = event.data ?? {};
|
|
108
108
|
const host = typeof data.host === "string" ? data.host : "";
|
|
109
109
|
const port = typeof data.port === "number" ? data.port : 0;
|
|
@@ -114,7 +114,7 @@ var LocalNetworkAddon = class extends _camstack_types.BaseAddon {
|
|
|
114
114
|
});
|
|
115
115
|
this.ctx.logger.info("local-network initialized", { meta: { interfaceCount: this.enumerate().length } });
|
|
116
116
|
return [{
|
|
117
|
-
capability:
|
|
117
|
+
capability: require_dist.localNetworkCapability,
|
|
118
118
|
provider
|
|
119
119
|
}];
|
|
120
120
|
}
|
|
@@ -205,7 +205,7 @@ var LocalNetworkAddon = class extends _camstack_types.BaseAddon {
|
|
|
205
205
|
type: "core",
|
|
206
206
|
id: "local-network"
|
|
207
207
|
},
|
|
208
|
-
category:
|
|
208
|
+
category: require_dist.EventCategory.LocalNetworkChanged,
|
|
209
209
|
data: { count: interfaces.length }
|
|
210
210
|
});
|
|
211
211
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseAddon, EventCategory
|
|
1
|
+
import { N as localNetworkCapability, et as BaseAddon, st as EventCategory } from "../../dist-DlGZpWo8.mjs";
|
|
2
2
|
import * as os from "node:os";
|
|
3
3
|
//#region src/builtins/local-network/local-network.addon.ts
|
|
4
4
|
/**
|
|
@@ -3,9 +3,9 @@ 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-DriXJoVg.js");
|
|
6
7
|
let node_fs = require("node:fs");
|
|
7
8
|
node_fs = require_chunk.__toESM(node_fs);
|
|
8
|
-
let _camstack_types = require("@camstack/types");
|
|
9
9
|
let node_child_process = require("node:child_process");
|
|
10
10
|
let node_util = require("node:util");
|
|
11
11
|
let node_os = require("node:os");
|
|
@@ -578,7 +578,7 @@ function narrowWorkerState(state) {
|
|
|
578
578
|
* Native metrics — CPU, memory, disk usage sampling.
|
|
579
579
|
* Settings appear under Cluster → NodeDetail → Settings.
|
|
580
580
|
*/
|
|
581
|
-
var NativeMetricsAddon = class extends
|
|
581
|
+
var NativeMetricsAddon = class extends require_dist.BaseAddon {
|
|
582
582
|
provider = null;
|
|
583
583
|
startedAtMs = Date.now();
|
|
584
584
|
snapshotTimer = null;
|
|
@@ -618,7 +618,7 @@ var NativeMetricsAddon = class extends _camstack_types.BaseAddon {
|
|
|
618
618
|
this.snapshotTimer = setInterval(() => this.emitResourcesSnapshot(), METRICS_SNAPSHOT_INTERVAL_MS);
|
|
619
619
|
this.processSnapshotTimer = setInterval(() => this.emitProcessesSnapshot(), PROCESS_SNAPSHOT_INTERVAL_MS);
|
|
620
620
|
return [{
|
|
621
|
-
capability:
|
|
621
|
+
capability: require_dist.metricsProviderCapability,
|
|
622
622
|
provider: composed
|
|
623
623
|
}];
|
|
624
624
|
}
|
|
@@ -664,7 +664,7 @@ var NativeMetricsAddon = class extends _camstack_types.BaseAddon {
|
|
|
664
664
|
coarse,
|
|
665
665
|
emittedAt: timestamp
|
|
666
666
|
};
|
|
667
|
-
eventBus.emit(
|
|
667
|
+
eventBus.emit(require_dist.createEvent(require_dist.EventCategory.MetricsNodeResourcesSnapshot, {
|
|
668
668
|
type: "node",
|
|
669
669
|
id: nodeId,
|
|
670
670
|
nodeId
|
|
@@ -697,7 +697,7 @@ var NativeMetricsAddon = class extends _camstack_types.BaseAddon {
|
|
|
697
697
|
coarse,
|
|
698
698
|
emittedAt: timestamp
|
|
699
699
|
};
|
|
700
|
-
eventBus.emit(
|
|
700
|
+
eventBus.emit(require_dist.createEvent(require_dist.EventCategory.MetricsNodeProcessesSnapshot, {
|
|
701
701
|
type: "node",
|
|
702
702
|
id: nodeId,
|
|
703
703
|
nodeId
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { I as metricsProviderCapability, et as BaseAddon, mt as createEvent, st as EventCategory } from "../../dist-DlGZpWo8.mjs";
|
|
1
2
|
import * as fs from "node:fs";
|
|
2
|
-
import { BaseAddon, EventCategory, createEvent, metricsProviderCapability } from "@camstack/types";
|
|
3
3
|
import { execFile, execFileSync } from "node:child_process";
|
|
4
4
|
import { promisify } from "node:util";
|
|
5
5
|
import * as os from "node:os";
|
|
@@ -3,9 +3,9 @@ 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-DriXJoVg.js");
|
|
6
7
|
let node_fs = require("node:fs");
|
|
7
8
|
node_fs = require_chunk.__toESM(node_fs);
|
|
8
|
-
let _camstack_types = require("@camstack/types");
|
|
9
9
|
let node_child_process = require("node:child_process");
|
|
10
10
|
let node_util = require("node:util");
|
|
11
11
|
let node_os = require("node:os");
|
|
@@ -42,7 +42,7 @@ async function getAvailableRAM_MB() {
|
|
|
42
42
|
const mem = await (await import("systeminformation")).mem();
|
|
43
43
|
return Math.round(mem.available / 1024 / 1024);
|
|
44
44
|
} catch (err) {
|
|
45
|
-
console.debug(`systeminformation not available, using platform-specific RAM probe: ${
|
|
45
|
+
console.debug(`systeminformation not available, using platform-specific RAM probe: ${require_dist.errMsg(err)}`);
|
|
46
46
|
const platform = node_os.platform();
|
|
47
47
|
try {
|
|
48
48
|
if (platform === "darwin") {
|
|
@@ -61,7 +61,7 @@ async function getAvailableRAM_MB() {
|
|
|
61
61
|
if (match) return Math.round(parseInt(match[1]) / 1024);
|
|
62
62
|
}
|
|
63
63
|
} catch (probeErr) {
|
|
64
|
-
console.debug(`RAM probe failed, using total RAM fallback: ${
|
|
64
|
+
console.debug(`RAM probe failed, using total RAM fallback: ${require_dist.errMsg(probeErr)}`);
|
|
65
65
|
}
|
|
66
66
|
return Math.round(node_os.totalmem() / 1024 / 1024);
|
|
67
67
|
}
|
|
@@ -110,7 +110,7 @@ var PlatformScorer = class {
|
|
|
110
110
|
if (hardware.gpu) this.logger.info("GPU detected", { meta: { name: hardware.gpu.name } });
|
|
111
111
|
if (hardware.npu) this.logger.info("NPU detected", { meta: { type: hardware.npu.type } });
|
|
112
112
|
onPhase?.("hardware", { hardware });
|
|
113
|
-
const { scores, best: bestScore } =
|
|
113
|
+
const { scores, best: bestScore } = require_dist.scoreRuntimes(hardware);
|
|
114
114
|
const pythonPath = await this.resolvePythonPath();
|
|
115
115
|
if (pythonPath) this.logger.info("Python interpreter located", { meta: { pythonPath } });
|
|
116
116
|
else this.logger.info("Python: not found");
|
|
@@ -185,7 +185,7 @@ var PlatformScorer = class {
|
|
|
185
185
|
};
|
|
186
186
|
}
|
|
187
187
|
} catch (err) {
|
|
188
|
-
this.logger.debug("NVIDIA GPU detection failed", { meta: { error:
|
|
188
|
+
this.logger.debug("NVIDIA GPU detection failed", { meta: { error: require_dist.errMsg(err) } });
|
|
189
189
|
}
|
|
190
190
|
if (!gpu || !npu) {
|
|
191
191
|
const { classifyIntelAccelerators } = await Promise.resolve().then(() => require("../../intel-accelerators-Gg0P5mnl.js"));
|
|
@@ -240,7 +240,7 @@ var PlatformScorer = class {
|
|
|
240
240
|
await execFileAsync(cmd, ["--version"], { timeout: 5e3 });
|
|
241
241
|
return cmd;
|
|
242
242
|
} catch (err) {
|
|
243
|
-
this.logger.debug(`Python command "${cmd}" not found`, { meta: { error:
|
|
243
|
+
this.logger.debug(`Python command "${cmd}" not found`, { meta: { error: require_dist.errMsg(err) } });
|
|
244
244
|
}
|
|
245
245
|
return null;
|
|
246
246
|
}
|
|
@@ -364,7 +364,7 @@ function narrowHwAccelPrefer(value) {
|
|
|
364
364
|
if (typeof value === "string" && isHwAccelBackend(value)) return value;
|
|
365
365
|
return null;
|
|
366
366
|
}
|
|
367
|
-
var PlatformProbeNativeAddon = class extends
|
|
367
|
+
var PlatformProbeNativeAddon = class extends require_dist.BaseAddon {
|
|
368
368
|
scorer = null;
|
|
369
369
|
cachedCaps = null;
|
|
370
370
|
/**
|
|
@@ -401,8 +401,8 @@ var PlatformProbeNativeAddon = class extends _camstack_types.BaseAddon {
|
|
|
401
401
|
if (!ctx) return;
|
|
402
402
|
const nodeId = this.bareLocalNodeId();
|
|
403
403
|
try {
|
|
404
|
-
|
|
405
|
-
capName:
|
|
404
|
+
require_dist.emitReadiness(ctx.eventBus, {
|
|
405
|
+
capName: require_dist.platformProbeCapability.name,
|
|
406
406
|
scope: {
|
|
407
407
|
type: "node",
|
|
408
408
|
nodeId
|
|
@@ -416,7 +416,7 @@ var PlatformProbeNativeAddon = class extends _camstack_types.BaseAddon {
|
|
|
416
416
|
async onInitialize() {
|
|
417
417
|
this.emitProbeReadiness("starting");
|
|
418
418
|
const embeddedPython = await this.ctx.deps.ensurePython().catch((err) => {
|
|
419
|
-
this.ctx.logger.debug("ensurePython unavailable for platform probe", { meta: { error:
|
|
419
|
+
this.ctx.logger.debug("ensurePython unavailable for platform probe", { meta: { error: require_dist.errMsg(err) } });
|
|
420
420
|
return null;
|
|
421
421
|
});
|
|
422
422
|
this.scorer = new PlatformScorer(this.ctx.logger, embeddedPython);
|
|
@@ -428,7 +428,7 @@ var PlatformProbeNativeAddon = class extends _camstack_types.BaseAddon {
|
|
|
428
428
|
type: "core",
|
|
429
429
|
id: "platform-probe-native"
|
|
430
430
|
},
|
|
431
|
-
category:
|
|
431
|
+
category: require_dist.EventCategory.PlatformProbePhase,
|
|
432
432
|
data: {
|
|
433
433
|
type: "platform-probe.phase",
|
|
434
434
|
phase,
|
|
@@ -449,7 +449,7 @@ var PlatformProbeNativeAddon = class extends _camstack_types.BaseAddon {
|
|
|
449
449
|
this.emitProbeReadiness("ready");
|
|
450
450
|
return caps;
|
|
451
451
|
}).catch((err) => {
|
|
452
|
-
const msg =
|
|
452
|
+
const msg = require_dist.errMsg(err);
|
|
453
453
|
this.ctx.logger.error("Platform probe failed", { meta: { error: msg } });
|
|
454
454
|
emitPhase("error", { message: msg });
|
|
455
455
|
throw err;
|
|
@@ -458,7 +458,7 @@ var PlatformProbeNativeAddon = class extends _camstack_types.BaseAddon {
|
|
|
458
458
|
return this.cachedCaps ?? probePromise;
|
|
459
459
|
};
|
|
460
460
|
return [{
|
|
461
|
-
capability:
|
|
461
|
+
capability: require_dist.platformProbeCapability,
|
|
462
462
|
provider: {
|
|
463
463
|
getCapabilities: async () => {
|
|
464
464
|
return getCaps();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { $ as errMsg, B as platformProbeCapability, U as scoreRuntimes, et as BaseAddon, gt as emitReadiness, st as EventCategory } from "../../dist-DlGZpWo8.mjs";
|
|
1
2
|
import * as fs from "node:fs";
|
|
2
|
-
import { BaseAddon, EventCategory, emitReadiness, errMsg, platformProbeCapability, scoreRuntimes } from "@camstack/types";
|
|
3
3
|
import { execFile } from "node:child_process";
|
|
4
4
|
import { promisify } from "node:util";
|
|
5
5
|
import * as os from "node:os";
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
|
|
6
|
+
const require_dist = require("../../dist-DriXJoVg.js");
|
|
7
7
|
//#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
|
|
8
8
|
/**
|
|
9
9
|
* Reconcile the durable `enabledProviders` set against authoritative
|
|
@@ -67,16 +67,16 @@ function reconcileEnabledProviders(currentEnabled, probes) {
|
|
|
67
67
|
* stopped). Running before `autoStartEnabledProviders` is safe:
|
|
68
68
|
* it can only add already-connected providers, never evict.
|
|
69
69
|
*/
|
|
70
|
-
var RemoteAccessOrchestratorAddon = class extends
|
|
70
|
+
var RemoteAccessOrchestratorAddon = class extends require_dist.BaseAddon {
|
|
71
71
|
constructor() {
|
|
72
72
|
super({ enabledProviders: [] });
|
|
73
73
|
}
|
|
74
74
|
async onInitialize() {
|
|
75
75
|
this.ctx.logger.info("Remote-access orchestrator initialized (backend-only)", { meta: { enabledCount: this.config.enabledProviders.length } });
|
|
76
|
-
this.ctx.eventBus?.subscribe({ category:
|
|
76
|
+
this.ctx.eventBus?.subscribe({ category: require_dist.EventCategory.NetworkTunnelStarted }, (event) => {
|
|
77
77
|
this.onTunnelLifecycle(event.source, true);
|
|
78
78
|
});
|
|
79
|
-
this.ctx.eventBus?.subscribe({ category:
|
|
79
|
+
this.ctx.eventBus?.subscribe({ category: require_dist.EventCategory.NetworkTunnelStopped }, (event) => {
|
|
80
80
|
this.onTunnelLifecycle(event.source, false);
|
|
81
81
|
});
|
|
82
82
|
setImmediate(() => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseAddon, EventCategory } from "
|
|
1
|
+
import { et as BaseAddon, st as EventCategory } from "../../dist-DlGZpWo8.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
|
-
|
|
6
|
+
const require_dist = require("../../dist-DriXJoVg.js");
|
|
7
7
|
let node_child_process = require("node:child_process");
|
|
8
8
|
//#region src/builtins/snapshot/snapshot.addon.ts
|
|
9
9
|
/** Default cache window for non-battery cams (seconds). 10s feels live. */
|
|
@@ -28,7 +28,7 @@ var BATTERY_DEFAULT_MAX_AGE_S = 3600;
|
|
|
28
28
|
* ffmpeg fallback, caching) is this addon's concern; stream-broker only
|
|
29
29
|
* publishes stream endpoints.
|
|
30
30
|
*/
|
|
31
|
-
var SnapshotAddon = class SnapshotAddon extends
|
|
31
|
+
var SnapshotAddon = class SnapshotAddon extends require_dist.BaseAddon {
|
|
32
32
|
cache = /* @__PURE__ */ new Map();
|
|
33
33
|
/**
|
|
34
34
|
* Cached resolution of `pipelineOrchestrator.getIngestOwner` — SnapshotAddon
|
|
@@ -46,7 +46,7 @@ var SnapshotAddon = class SnapshotAddon extends _camstack_types.BaseAddon {
|
|
|
46
46
|
async onInitialize() {
|
|
47
47
|
this.ctx.logger.info("Snapshot wrapper initialized");
|
|
48
48
|
return [{
|
|
49
|
-
capability:
|
|
49
|
+
capability: require_dist.snapshotCapability,
|
|
50
50
|
provider: {
|
|
51
51
|
getSnapshot: (input) => this.getSnapshot(input),
|
|
52
52
|
invalidateCache: (input) => this.invalidateCache(input),
|
|
@@ -124,7 +124,7 @@ var SnapshotAddon = class SnapshotAddon extends _camstack_types.BaseAddon {
|
|
|
124
124
|
let nativeError = null;
|
|
125
125
|
let nativeAbsent = false;
|
|
126
126
|
try {
|
|
127
|
-
const native = this.ctx.getNativeProvider(
|
|
127
|
+
const native = this.ctx.getNativeProvider(require_dist.snapshotCapability, deviceId);
|
|
128
128
|
if (native) {
|
|
129
129
|
const result = await native.getSnapshot(input);
|
|
130
130
|
if (result) {
|
|
@@ -141,7 +141,7 @@ var SnapshotAddon = class SnapshotAddon extends _camstack_types.BaseAddon {
|
|
|
141
141
|
log.debug("native snapshot provider not resolved — falling through to broker", { tags: { deviceId } });
|
|
142
142
|
}
|
|
143
143
|
} catch (err) {
|
|
144
|
-
const msg =
|
|
144
|
+
const msg = require_dist.errMsg(err);
|
|
145
145
|
if (isAbsentNativeError(msg)) {
|
|
146
146
|
nativeAbsent = true;
|
|
147
147
|
log.debug("native snapshot absent", {
|
|
@@ -169,7 +169,7 @@ var SnapshotAddon = class SnapshotAddon extends _camstack_types.BaseAddon {
|
|
|
169
169
|
} catch (err) {
|
|
170
170
|
log.warn("stream-broker snapshot fallback failed", {
|
|
171
171
|
tags: { deviceId },
|
|
172
|
-
meta: { error:
|
|
172
|
+
meta: { error: require_dist.errMsg(err) }
|
|
173
173
|
});
|
|
174
174
|
}
|
|
175
175
|
else log.debug("snapshot: skipping broker fallback — battery device with absent native and no streaming broker", { tags: { deviceId } });
|
|
@@ -284,7 +284,7 @@ var SnapshotAddon = class SnapshotAddon extends _camstack_types.BaseAddon {
|
|
|
284
284
|
try {
|
|
285
285
|
return await this.ctx.api.pipelineOrchestrator.getIngestOwner.query();
|
|
286
286
|
} catch (err) {
|
|
287
|
-
this.ctx.logger.warn("snapshot: getIngestOwner unavailable — defaulting to hub (cap not mounted yet?)", { meta: { error:
|
|
287
|
+
this.ctx.logger.warn("snapshot: getIngestOwner unavailable — defaulting to hub (cap not mounted yet?)", { meta: { error: require_dist.errMsg(err) } });
|
|
288
288
|
return { ownerNodeId: "hub" };
|
|
289
289
|
}
|
|
290
290
|
}
|
|
@@ -298,7 +298,7 @@ var SnapshotAddon = class SnapshotAddon extends _camstack_types.BaseAddon {
|
|
|
298
298
|
try {
|
|
299
299
|
buf = await runFfmpegFrameGrab(url, 15e3);
|
|
300
300
|
} catch (err) {
|
|
301
|
-
if (isBrokerColdError(
|
|
301
|
+
if (isBrokerColdError(require_dist.errMsg(err))) {
|
|
302
302
|
this.ctx.logger.debug("grabFrame: broker-resume race — retrying in 1500ms", { tags: { deviceId } });
|
|
303
303
|
await new Promise((r) => setTimeout(r, 1500));
|
|
304
304
|
buf = await runFfmpegFrameGrab(url, 15e3);
|
|
@@ -380,7 +380,7 @@ var SnapshotAddon = class SnapshotAddon extends _camstack_types.BaseAddon {
|
|
|
380
380
|
}
|
|
381
381
|
async buildDeviceSettingsContribution(deviceId) {
|
|
382
382
|
const meta = await this.lookupDeviceMeta(deviceId);
|
|
383
|
-
if (meta && meta.type !==
|
|
383
|
+
if (meta && meta.type !== require_dist.DeviceType.Camera) return null;
|
|
384
384
|
const current = await this.readDeviceSettings(deviceId);
|
|
385
385
|
const streamOptions = await this.getStreamOptions(deviceId);
|
|
386
386
|
const isBattery = await this.isDeviceBattery(deviceId);
|
|
@@ -442,7 +442,7 @@ var SnapshotAddon = class SnapshotAddon extends _camstack_types.BaseAddon {
|
|
|
442
442
|
const rawType = found.type;
|
|
443
443
|
return {
|
|
444
444
|
...found.name ? { name: found.name } : {},
|
|
445
|
-
isBattery: features.includes(
|
|
445
|
+
isBattery: features.includes(require_dist.DeviceFeature.BatteryOperated),
|
|
446
446
|
...rawType ? { type: rawType } : {}
|
|
447
447
|
};
|
|
448
448
|
} catch (err) {
|
|
@@ -479,12 +479,12 @@ var SnapshotAddon = class SnapshotAddon extends _camstack_types.BaseAddon {
|
|
|
479
479
|
label: "Auto"
|
|
480
480
|
}, ...entries.filter((e) => e.enabled).map((e) => e.brokerId.slice(prefix.length)).map((id) => ({
|
|
481
481
|
value: id,
|
|
482
|
-
label:
|
|
482
|
+
label: require_dist.streamQualityLabel(id)
|
|
483
483
|
}))];
|
|
484
484
|
} catch (err) {
|
|
485
485
|
this.ctx.logger.error("getStreamOptions failed", {
|
|
486
486
|
tags: { deviceId },
|
|
487
|
-
meta: { error:
|
|
487
|
+
meta: { error: require_dist.errMsg(err) }
|
|
488
488
|
});
|
|
489
489
|
return [{
|
|
490
490
|
value: "auto",
|
|
@@ -539,7 +539,7 @@ function isAbsentNativeError(msg) {
|
|
|
539
539
|
async function fetchSnapshotBrokerEntries(api, params) {
|
|
540
540
|
const { deviceId, ownerNodeId, reachableHost } = params;
|
|
541
541
|
const prefix = `${deviceId}/`;
|
|
542
|
-
const pin =
|
|
542
|
+
const pin = require_dist.nodePin(ownerNodeId);
|
|
543
543
|
const [allEntries, allSlots] = await Promise.all([api.streamBroker.getAllRtspEntries.query(reachableHost !== void 0 ? { hostname: reachableHost } : {}, pin), api.streamBroker.listAllProfileSlots.query(void 0, pin)]);
|
|
544
544
|
return {
|
|
545
545
|
entries: allEntries.filter((e) => e.brokerId.startsWith(prefix)),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as errMsg, K as snapshotCapability, L as nodePin, Y as streamQualityLabel, et as BaseAddon, it as DeviceFeature, ot as DeviceType } from "../../dist-DlGZpWo8.mjs";
|
|
2
2
|
import { execFile } from "node:child_process";
|
|
3
3
|
//#region src/builtins/snapshot/snapshot.addon.ts
|
|
4
4
|
/** Default cache window for non-battery cams (seconds). 10s feels live. */
|
|
@@ -3,11 +3,11 @@ 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-DriXJoVg.js");
|
|
6
7
|
let node_fs = require("node:fs");
|
|
7
8
|
node_fs = require_chunk.__toESM(node_fs);
|
|
8
9
|
let node_path = require("node:path");
|
|
9
10
|
node_path = require_chunk.__toESM(node_path);
|
|
10
|
-
let _camstack_types = require("@camstack/types");
|
|
11
11
|
let node_crypto = require("node:crypto");
|
|
12
12
|
let node_os = require("node:os");
|
|
13
13
|
let node_fs_promises = require("node:fs/promises");
|
|
@@ -362,7 +362,7 @@ function defaultAllowedRoots() {
|
|
|
362
362
|
* provider itself is now stateless — every call carries the live
|
|
363
363
|
* `StorageLocation` inline.
|
|
364
364
|
*/
|
|
365
|
-
var FilesystemStorageAddon = class extends
|
|
365
|
+
var FilesystemStorageAddon = class extends require_dist.BaseAddon {
|
|
366
366
|
provider = null;
|
|
367
367
|
constructor() {
|
|
368
368
|
super({
|
|
@@ -375,10 +375,10 @@ var FilesystemStorageAddon = class extends _camstack_types.BaseAddon {
|
|
|
375
375
|
const browse = new FilesystemBrowseProvider(() => this.config.storageAllowedRoots);
|
|
376
376
|
this.ctx.logger.info("Filesystem storage-provider initialized");
|
|
377
377
|
return [{
|
|
378
|
-
capability:
|
|
378
|
+
capability: require_dist.storageProviderCapability,
|
|
379
379
|
provider: this.provider
|
|
380
380
|
}, {
|
|
381
|
-
capability:
|
|
381
|
+
capability: require_dist.filesystemBrowseCapability,
|
|
382
382
|
provider: browse
|
|
383
383
|
}];
|
|
384
384
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { E as filesystemBrowseCapability, J as storageProviderCapability, et as BaseAddon } from "../../dist-DlGZpWo8.mjs";
|
|
1
2
|
import * as fs from "node:fs";
|
|
2
3
|
import * as path$1 from "node:path";
|
|
3
4
|
import { basename, dirname, join, resolve, sep } from "node:path";
|
|
4
|
-
import { BaseAddon, filesystemBrowseCapability, storageProviderCapability } from "@camstack/types";
|
|
5
5
|
import { randomUUID } from "node:crypto";
|
|
6
6
|
import { homedir } from "node:os";
|
|
7
7
|
import { mkdir, readdir, realpath, statfs } from "node:fs/promises";
|
|
@@ -3,13 +3,13 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
|
|
6
|
+
const require_dist = require("../../dist-DriXJoVg.js");
|
|
7
7
|
let node_crypto = require("node:crypto");
|
|
8
8
|
let better_sqlite3 = require("better-sqlite3");
|
|
9
9
|
better_sqlite3 = require_chunk.__toESM(better_sqlite3);
|
|
10
10
|
//#region src/builtins/sqlite-storage/sqlite-settings-backend.ts
|
|
11
11
|
function parseRowData(raw) {
|
|
12
|
-
return
|
|
12
|
+
return require_dist.asJsonObject(require_dist.parseJsonUnknown(raw)) ?? {};
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* SQLite implementation of ISettingsBackend.
|
|
@@ -564,11 +564,11 @@ var SqliteSettingsBackend = class SqliteSettingsBackend {
|
|
|
564
564
|
sql += ` OFFSET ?`;
|
|
565
565
|
values.push(options.offset);
|
|
566
566
|
}
|
|
567
|
-
return this.getDb().prepare(sql).all(...values).flatMap((r) =>
|
|
567
|
+
return this.getDb().prepare(sql).all(...values).flatMap((r) => require_dist.asJsonObject(r) ? [require_dist.asJsonObject(r)] : []);
|
|
568
568
|
}
|
|
569
569
|
async tableGet(table, filter) {
|
|
570
570
|
const { whereSql, whereValues } = this.buildWhere(filter);
|
|
571
|
-
return
|
|
571
|
+
return require_dist.asJsonObject(this.getDb().prepare(`SELECT * FROM "${table}"${whereSql} LIMIT 1`).get(...whereValues));
|
|
572
572
|
}
|
|
573
573
|
async tableCount(table, filter) {
|
|
574
574
|
let sql = `SELECT COUNT(*) as count FROM "${table}"`;
|
|
@@ -578,7 +578,7 @@ var SqliteSettingsBackend = class SqliteSettingsBackend {
|
|
|
578
578
|
sql += whereSql;
|
|
579
579
|
values.push(...whereValues);
|
|
580
580
|
}
|
|
581
|
-
const row =
|
|
581
|
+
const row = require_dist.asJsonObject(this.getDb().prepare(sql).get(...values));
|
|
582
582
|
return typeof row?.count === "number" ? row.count : 0;
|
|
583
583
|
}
|
|
584
584
|
buildWhere(filter) {
|
|
@@ -600,7 +600,7 @@ var SqliteSettingsBackend = class SqliteSettingsBackend {
|
|
|
600
600
|
* SQLite Settings addon — provides persistent settings storage.
|
|
601
601
|
* Capability: 'settings-store' (singleton)
|
|
602
602
|
*/
|
|
603
|
-
var SqliteSettingsAddon = class extends
|
|
603
|
+
var SqliteSettingsAddon = class extends require_dist.BaseAddon {
|
|
604
604
|
backend = null;
|
|
605
605
|
constructor() {
|
|
606
606
|
super({});
|
|
@@ -616,18 +616,18 @@ var SqliteSettingsAddon = class extends _camstack_types.BaseAddon {
|
|
|
616
616
|
dbExists = fs.existsSync(dbPath);
|
|
617
617
|
if (!dbExists) await fs.promises.mkdir(path.dirname(dbPath), { recursive: true });
|
|
618
618
|
} catch (err) {
|
|
619
|
-
this.ctx.logger.warn("Failed to check/create DB directory", { meta: { error:
|
|
619
|
+
this.ctx.logger.warn("Failed to check/create DB directory", { meta: { error: require_dist.errMsg(err) } });
|
|
620
620
|
}
|
|
621
621
|
this.ctx.logger.info("DB path resolved", { meta: {
|
|
622
622
|
pathSource,
|
|
623
623
|
dbPath
|
|
624
624
|
} });
|
|
625
625
|
this.ctx.logger.info("DB file status", { meta: { dbExists } });
|
|
626
|
-
this.backend = new SqliteSettingsBackend(dbPath, { ...
|
|
626
|
+
this.backend = new SqliteSettingsBackend(dbPath, { ...require_dist.RUNTIME_DEFAULTS });
|
|
627
627
|
await this.backend.initialize();
|
|
628
628
|
this.ctx.logger.info("Initialized successfully");
|
|
629
629
|
return [{
|
|
630
|
-
capability:
|
|
630
|
+
capability: require_dist.settingsStoreCapability,
|
|
631
631
|
provider: this.backend
|
|
632
632
|
}];
|
|
633
633
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as errMsg, G as settingsStoreCapability, dt as asJsonObject, et as BaseAddon, s as RUNTIME_DEFAULTS, xt as parseJsonUnknown } from "../../dist-DlGZpWo8.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import Database from "better-sqlite3";
|
|
4
4
|
//#region src/builtins/sqlite-storage/sqlite-settings-backend.ts
|
|
@@ -3,9 +3,9 @@ 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-DriXJoVg.js");
|
|
6
7
|
let node_path = require("node:path");
|
|
7
8
|
node_path = require_chunk.__toESM(node_path);
|
|
8
|
-
let _camstack_types = require("@camstack/types");
|
|
9
9
|
let node_fs_promises = require("node:fs/promises");
|
|
10
10
|
node_fs_promises = require_chunk.__toESM(node_fs_promises);
|
|
11
11
|
let _camstack_system = require("@camstack/system");
|
|
@@ -566,13 +566,13 @@ function mapLocationToRow(loc) {
|
|
|
566
566
|
*/
|
|
567
567
|
function mapRowToLocation(row) {
|
|
568
568
|
const typeRaw = row["type"];
|
|
569
|
-
const parsedType =
|
|
569
|
+
const parsedType = require_dist.StorageLocationTypeSchema.safeParse(typeRaw);
|
|
570
570
|
if (!parsedType.success) return null;
|
|
571
571
|
const type = parsedType.data;
|
|
572
572
|
const id = String(row["id"] ?? "");
|
|
573
573
|
if (!id) return null;
|
|
574
574
|
const configRaw = row["config"];
|
|
575
|
-
const storedConfig = typeof configRaw === "string" && configRaw.length > 0 ?
|
|
575
|
+
const storedConfig = typeof configRaw === "string" && configRaw.length > 0 ? require_dist.parseJsonObject(configRaw) ?? {} : {};
|
|
576
576
|
const nodeIdRaw = storedConfig[NODE_ID_CONFIG_KEY];
|
|
577
577
|
const nodeId = typeof nodeIdRaw === "string" && nodeIdRaw.length > 0 ? nodeIdRaw : void 0;
|
|
578
578
|
const config = { ...storedConfig };
|
|
@@ -712,7 +712,7 @@ var PRESSURE_SWEEP_INTERVAL_MS = 6e4;
|
|
|
712
712
|
* infra layer (every cap-bound event is a custom-shape payload).
|
|
713
713
|
*/
|
|
714
714
|
var CAP_PROVIDER_REGISTERED_CATEGORY = "capability:provider-registered";
|
|
715
|
-
var StorageOrchestratorAddon = class extends
|
|
715
|
+
var StorageOrchestratorAddon = class extends require_dist.BaseAddon {
|
|
716
716
|
service = null;
|
|
717
717
|
pressureManager = null;
|
|
718
718
|
pressureTimer = null;
|
|
@@ -930,7 +930,7 @@ var StorageOrchestratorAddon = class extends _camstack_types.BaseAddon {
|
|
|
930
930
|
}, PRESSURE_SWEEP_INTERVAL_MS);
|
|
931
931
|
this.ctx.logger.info("Storage orchestrator initialized");
|
|
932
932
|
return [{
|
|
933
|
-
capability:
|
|
933
|
+
capability: require_dist.storageCapability,
|
|
934
934
|
provider
|
|
935
935
|
}];
|
|
936
936
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { bt as parseJsonObject, et as BaseAddon, q as storageCapability, u as StorageLocationTypeSchema } from "../../dist-DlGZpWo8.mjs";
|
|
1
2
|
import * as path$1 from "node:path";
|
|
2
|
-
import { BaseAddon, StorageLocationTypeSchema, parseJsonObject, storageCapability } from "@camstack/types";
|
|
3
3
|
import * as fs from "node:fs/promises";
|
|
4
4
|
import { buildStorageLocationRegistry } from "@camstack/system";
|
|
5
5
|
//#region src/builtins/storage-orchestrator/storage-orchestrator.service.ts
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
|
|
6
|
+
const require_dist = require("../../dist-DriXJoVg.js");
|
|
7
7
|
//#region src/builtins/system-config/system-config.addon.ts
|
|
8
8
|
/**
|
|
9
9
|
* Built-in `system-config` addon — Phase 4 of the settings redesign.
|
|
@@ -54,7 +54,7 @@ var KEY_TO_SECTION = {
|
|
|
54
54
|
dataPath: "server",
|
|
55
55
|
tokenExpiry: "auth"
|
|
56
56
|
};
|
|
57
|
-
var SystemConfigAddon = class extends
|
|
57
|
+
var SystemConfigAddon = class extends require_dist.BaseAddon {
|
|
58
58
|
id = "system-config";
|
|
59
59
|
constructor() {
|
|
60
60
|
super({});
|
|
@@ -116,20 +116,20 @@ var SystemConfigAddon = class extends _camstack_types.BaseAddon {
|
|
|
116
116
|
}
|
|
117
117
|
async getGlobalSettings() {
|
|
118
118
|
const schema = this.buildGlobalSchema();
|
|
119
|
-
if (!this.ctx.settings) return
|
|
119
|
+
if (!this.ctx.settings) return require_dist.hydrateSchema(schema, {});
|
|
120
120
|
const sectionNames = Object.keys(SECTION_TITLES);
|
|
121
121
|
const merged = {};
|
|
122
122
|
for (const section of sectionNames) try {
|
|
123
123
|
const values = await this.ctx.settings.getSection(section);
|
|
124
124
|
Object.assign(merged, values);
|
|
125
125
|
} catch (err) {
|
|
126
|
-
const msg =
|
|
126
|
+
const msg = require_dist.errMsg(err);
|
|
127
127
|
this.ctx.logger.debug("Failed to read section", { meta: {
|
|
128
128
|
section,
|
|
129
129
|
error: msg
|
|
130
130
|
} });
|
|
131
131
|
}
|
|
132
|
-
return
|
|
132
|
+
return require_dist.hydrateSchema(schema, merged);
|
|
133
133
|
}
|
|
134
134
|
async updateGlobalSettings(patch) {
|
|
135
135
|
if (!this.ctx.settings) throw new Error("system-config: ctx.settings not available — cannot write sections");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as errMsg, et as BaseAddon, vt as hydrateSchema } from "../../dist-DlGZpWo8.mjs";
|
|
2
2
|
//#region src/builtins/system-config/system-config.addon.ts
|
|
3
3
|
/**
|
|
4
4
|
* Built-in `system-config` addon — Phase 4 of the settings redesign.
|
|
@@ -3,10 +3,10 @@ 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-DriXJoVg.js");
|
|
6
7
|
const require_formatter = require("../../formatter-DqAKDlvN.js");
|
|
7
8
|
let node_path = require("node:path");
|
|
8
9
|
node_path = require_chunk.__toESM(node_path);
|
|
9
|
-
let _camstack_types = require("@camstack/types");
|
|
10
10
|
let winston = require("winston");
|
|
11
11
|
winston = require_chunk.__toESM(winston);
|
|
12
12
|
let winston_daily_rotate_file = require("winston-daily-rotate-file");
|
|
@@ -74,7 +74,7 @@ var WinstonDestination = class {
|
|
|
74
74
|
* Winston logging addon — rotated log files + console output.
|
|
75
75
|
* Settings appear under Cluster → NodeDetail → Settings.
|
|
76
76
|
*/
|
|
77
|
-
var WinstonLoggingAddon = class extends
|
|
77
|
+
var WinstonLoggingAddon = class extends require_dist.BaseAddon {
|
|
78
78
|
destination = null;
|
|
79
79
|
constructor() {
|
|
80
80
|
super({
|
|
@@ -91,7 +91,7 @@ var WinstonLoggingAddon = class extends _camstack_types.BaseAddon {
|
|
|
91
91
|
});
|
|
92
92
|
this.ctx.logger.info("Winston logging initialized");
|
|
93
93
|
return [{
|
|
94
|
-
capability:
|
|
94
|
+
capability: require_dist.logDestinationCapability,
|
|
95
95
|
provider: this.destination
|
|
96
96
|
}];
|
|
97
97
|
}
|