camstack 1.2.55 → 1.2.57
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/cli.js
CHANGED
|
@@ -38,7 +38,7 @@ async function runServe(args) {
|
|
|
38
38
|
...typeof values.data === "string" ? { data: values.data } : {}
|
|
39
39
|
};
|
|
40
40
|
Object.assign(process.env, buildServeEnv(opts));
|
|
41
|
-
await import("./launcher-
|
|
41
|
+
await import("./launcher-5UCFBJXW.js");
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
// src/commands/agent.ts
|
|
@@ -83,7 +83,7 @@ async function runAgent(args) {
|
|
|
83
83
|
...typeof values.port === "string" ? { port: values.port } : {}
|
|
84
84
|
};
|
|
85
85
|
Object.assign(process.env, buildAgentEnv(opts));
|
|
86
|
-
await import("./launcher-
|
|
86
|
+
await import("./launcher-5UCFBJXW.js");
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
// src/commands/setup.ts
|
|
@@ -113905,9 +113905,9 @@ var require_dist2 = __commonJS({
|
|
|
113905
113905
|
}
|
|
113906
113906
|
});
|
|
113907
113907
|
|
|
113908
|
-
// ../system/dist/manifest-python-deps-
|
|
113909
|
-
var
|
|
113910
|
-
"../system/dist/manifest-python-deps-
|
|
113908
|
+
// ../system/dist/manifest-python-deps-BqWrDjSN.js
|
|
113909
|
+
var require_manifest_python_deps_BqWrDjSN = __commonJS({
|
|
113910
|
+
"../system/dist/manifest-python-deps-BqWrDjSN.js"(exports) {
|
|
113911
113911
|
"use strict";
|
|
113912
113912
|
var require_chunk = require_chunk_Cek0wNdY();
|
|
113913
113913
|
require_dist_CImxMt5h();
|
|
@@ -113932,6 +113932,7 @@ var require_manifest_python_deps_BaVekjRY = __commonJS({
|
|
|
113932
113932
|
var _camstack_types_addon = require_addon();
|
|
113933
113933
|
var node_net = __require("net");
|
|
113934
113934
|
var _trpc_client = require_dist2();
|
|
113935
|
+
var HUB_MAIN_HEAP_WATCH_LABEL = "hub-main";
|
|
113935
113936
|
var HEAP_WATCH_INTERVAL_MS = 6e4;
|
|
113936
113937
|
var HEAP_WATCH_WARN_RATIO = 0.8;
|
|
113937
113938
|
var HEAP_WATCH_ESCALATE_RATIO = 0.7;
|
|
@@ -113995,6 +113996,25 @@ var require_manifest_python_deps_BaVekjRY = __commonJS({
|
|
|
113995
113996
|
info: (line) => console.log(line),
|
|
113996
113997
|
warn: (line) => console.warn(line)
|
|
113997
113998
|
};
|
|
113999
|
+
function createDeferredHeapWatchSink(label = HUB_MAIN_HEAP_WATCH_LABEL, fallback = consoleSink) {
|
|
114000
|
+
let target = fallback;
|
|
114001
|
+
const sink = {
|
|
114002
|
+
info: (line) => {
|
|
114003
|
+
target.info(line);
|
|
114004
|
+
},
|
|
114005
|
+
warn: (line) => {
|
|
114006
|
+
target.warn(line);
|
|
114007
|
+
}
|
|
114008
|
+
};
|
|
114009
|
+
const attach = (next) => {
|
|
114010
|
+
target = next;
|
|
114011
|
+
next.info(`[mem] ${label} heartbeat attached to the log manager \u2014 earlier lines went to stdout only and are not in the log buffer, the rotated file or Loki.`);
|
|
114012
|
+
};
|
|
114013
|
+
return {
|
|
114014
|
+
sink,
|
|
114015
|
+
attach
|
|
114016
|
+
};
|
|
114017
|
+
}
|
|
113998
114018
|
function strandedMb(s) {
|
|
113999
114019
|
return s.rssMb - s.heapUsedMb - s.externalMb;
|
|
114000
114020
|
}
|
|
@@ -114054,7 +114074,7 @@ var require_manifest_python_deps_BaVekjRY = __commonJS({
|
|
|
114054
114074
|
if (loop === void 0) return line;
|
|
114055
114075
|
return `${line} loopP50=${loop.p50Ms}ms loopP99=${loop.p99Ms}ms loopMax=${loop.maxMs}ms`;
|
|
114056
114076
|
}
|
|
114057
|
-
function startHeapWatch(label =
|
|
114077
|
+
function startHeapWatch(label = HUB_MAIN_HEAP_WATCH_LABEL, sink = consoleSink, intervalMs = HEAP_WATCH_INTERVAL_MS, reclaimOptions, loopDelay = createLoopDelayMeter(), execArgv = process.execArgv, announceCeilingOrigin = true, rssBudget) {
|
|
114058
114078
|
const readMemory = reclaimOptions?.readMemory ?? (() => process.memoryUsage());
|
|
114059
114079
|
const now = reclaimOptions?.now ?? (() => Date.now());
|
|
114060
114080
|
const triggerMb = reclaimOptions?.triggerMb ?? 1024;
|
|
@@ -120743,6 +120763,12 @@ var require_manifest_python_deps_BaVekjRY = __commonJS({
|
|
|
120743
120763
|
return HUB_CAP_FWD_SERVICE;
|
|
120744
120764
|
}
|
|
120745
120765
|
});
|
|
120766
|
+
Object.defineProperty(exports, "HUB_MAIN_HEAP_WATCH_LABEL", {
|
|
120767
|
+
enumerable: true,
|
|
120768
|
+
get: function() {
|
|
120769
|
+
return HUB_MAIN_HEAP_WATCH_LABEL;
|
|
120770
|
+
}
|
|
120771
|
+
});
|
|
120746
120772
|
Object.defineProperty(exports, "HUB_MAIN_RSS_BUDGET_MB", {
|
|
120747
120773
|
enumerable: true,
|
|
120748
120774
|
get: function() {
|
|
@@ -120941,6 +120967,12 @@ var require_manifest_python_deps_BaVekjRY = __commonJS({
|
|
|
120941
120967
|
return createBrokerDeviceManagerApi;
|
|
120942
120968
|
}
|
|
120943
120969
|
});
|
|
120970
|
+
Object.defineProperty(exports, "createDeferredHeapWatchSink", {
|
|
120971
|
+
enumerable: true,
|
|
120972
|
+
get: function() {
|
|
120973
|
+
return createDeferredHeapWatchSink;
|
|
120974
|
+
}
|
|
120975
|
+
});
|
|
120944
120976
|
Object.defineProperty(exports, "createHubCapForwardService", {
|
|
120945
120977
|
enumerable: true,
|
|
120946
120978
|
get: function() {
|
|
@@ -125051,7 +125083,7 @@ var require_dist3 = __commonJS({
|
|
|
125051
125083
|
var require_builtins_winston_logging_index = require_winston_logging();
|
|
125052
125084
|
var require_file_data_plane = require_file_data_plane_DO8KbxCe();
|
|
125053
125085
|
var require_tls$1 = require_tls_u8QCJCFE();
|
|
125054
|
-
var require_manifest_python_deps =
|
|
125086
|
+
var require_manifest_python_deps = require_manifest_python_deps_BqWrDjSN();
|
|
125055
125087
|
var require_resource_monitor = require_resource_monitor_CdnzxBLP();
|
|
125056
125088
|
var require_custom_action_registry = require_custom_action_registry_jY0NOZK8();
|
|
125057
125089
|
var zod = require_zod();
|
|
@@ -205448,6 +205480,7 @@ globstar while`, t, d, e, f, m), this.matchOne(t.slice(d), e.slice(f), s)) retur
|
|
|
205448
205480
|
exports.HEAP_WATCH_WARN_RATIO = require_manifest_python_deps.HEAP_WATCH_WARN_RATIO;
|
|
205449
205481
|
exports.HUB_CAP_FWD_ACTION = require_manifest_python_deps.HUB_CAP_FWD_ACTION;
|
|
205450
205482
|
exports.HUB_CAP_FWD_SERVICE = require_manifest_python_deps.HUB_CAP_FWD_SERVICE;
|
|
205483
|
+
exports.HUB_MAIN_HEAP_WATCH_LABEL = require_manifest_python_deps.HUB_MAIN_HEAP_WATCH_LABEL;
|
|
205451
205484
|
exports.HUB_MAIN_RSS_BUDGET_MB = require_manifest_python_deps.HUB_MAIN_RSS_BUDGET_MB;
|
|
205452
205485
|
exports.HUB_RSS_BUDGET_ENV = require_manifest_python_deps.HUB_RSS_BUDGET_ENV;
|
|
205453
205486
|
exports.HubForwarderAddon = require_builtins_hub_forwarder_index.HubForwarderAddon$1;
|
|
@@ -205568,6 +205601,7 @@ globstar while`, t, d, e, f, m), this.matchOne(t.slice(d), e.slice(f), s)) retur
|
|
|
205568
205601
|
exports.createBroker = createBroker2;
|
|
205569
205602
|
exports.createBrokerDeviceManagerApi = require_manifest_python_deps.createBrokerDeviceManagerApi;
|
|
205570
205603
|
exports.createCoreCapService = createCoreCapService;
|
|
205604
|
+
exports.createDeferredHeapWatchSink = require_manifest_python_deps.createDeferredHeapWatchSink;
|
|
205571
205605
|
exports.createDoorSettingsView = createDoorSettingsView;
|
|
205572
205606
|
exports.createFileDataPlaneHandler = require_file_data_plane.createFileDataPlaneHandler;
|
|
205573
205607
|
exports.createHubCapForwardService = require_manifest_python_deps.createHubCapForwardService;
|
|
@@ -413572,6 +413606,7 @@ var require_require_cache = __commonJS({
|
|
|
413572
413606
|
};
|
|
413573
413607
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
413574
413608
|
exports.purgeRequireCacheUnder = purgeRequireCacheUnder;
|
|
413609
|
+
exports.bundleGraphRootFor = bundleGraphRootFor;
|
|
413575
413610
|
var node_fs_1 = __importDefault(__require("fs"));
|
|
413576
413611
|
var node_path_1 = __importDefault(__require("path"));
|
|
413577
413612
|
function purgeRequireCacheUnder(dir) {
|
|
@@ -413587,6 +413622,11 @@ var require_require_cache = __commonJS({
|
|
|
413587
413622
|
} catch {
|
|
413588
413623
|
}
|
|
413589
413624
|
}
|
|
413625
|
+
function bundleGraphRootFor(addonDir, entryPath) {
|
|
413626
|
+
const distDir = node_path_1.default.resolve(addonDir, "dist");
|
|
413627
|
+
const withSep = distDir.endsWith(node_path_1.default.sep) ? distDir : `${distDir}${node_path_1.default.sep}`;
|
|
413628
|
+
return entryPath.startsWith(withSep) ? distDir : node_path_1.default.dirname(entryPath);
|
|
413629
|
+
}
|
|
413590
413630
|
function candidatePrefixes(dir) {
|
|
413591
413631
|
const withSep = (d) => d.endsWith(node_path_1.default.sep) ? d : `${d}${node_path_1.default.sep}`;
|
|
413592
413632
|
const given = withSep(dir);
|
|
@@ -416148,8 +416188,9 @@ var require_addon_registry_service = __commonJS({
|
|
|
416148
416188
|
return;
|
|
416149
416189
|
let catalog;
|
|
416150
416190
|
try {
|
|
416151
|
-
const
|
|
416152
|
-
|
|
416191
|
+
const graphRoot = (0, require_cache_js_1.bundleGraphRootFor)(addonDir, entryPath);
|
|
416192
|
+
const modUnknown = await this.moduleLoadSerializer.run(graphRoot, async () => {
|
|
416193
|
+
(0, require_cache_js_1.purgeRequireCacheUnder)(graphRoot);
|
|
416153
416194
|
const cacheBustedUrl = `${(0, node_url_1.pathToFileURL)(entryPath).href}?t=${Date.now()}`;
|
|
416154
416195
|
const nativeImport = new Function("specifier", "return import(specifier)");
|
|
416155
416196
|
return nativeImport(cacheBustedUrl);
|
|
@@ -420620,7 +420661,8 @@ var require_main4 = __commonJS({
|
|
|
420620
420661
|
async function bootstrap() {
|
|
420621
420662
|
const heapReclaimer = (0, system_1.createV8Reclaimer)();
|
|
420622
420663
|
const heapReclaim = heapReclaimer === void 0 ? void 0 : { reclaim: heapReclaimer };
|
|
420623
|
-
|
|
420664
|
+
const heapWatchSink = (0, system_1.createDeferredHeapWatchSink)(system_1.HUB_MAIN_HEAP_WATCH_LABEL);
|
|
420665
|
+
(0, system_1.startHeapWatch)(system_1.HUB_MAIN_HEAP_WATCH_LABEL, heapWatchSink.sink, void 0, heapReclaim, void 0, void 0, true, (0, system_1.hubMainRssBudget)());
|
|
420624
420666
|
cleanupOrphanProcesses();
|
|
420625
420667
|
let spaIndexHtml = null;
|
|
420626
420668
|
const configPath = process.env.CONFIG_PATH ?? path.join(process.env.CAMSTACK_DATA ?? path.join(process.cwd(), "camstack-data"), "config.yaml");
|
|
@@ -420664,6 +420706,15 @@ var require_main4 = __commonJS({
|
|
|
420664
420706
|
console.warn("[bootstrap] Failed to register addon upload route:", err);
|
|
420665
420707
|
}
|
|
420666
420708
|
const loggingService = app.get(logging_service_1.LoggingService);
|
|
420709
|
+
const heapWatchLogger = loggingService.createLogger("heap-watch");
|
|
420710
|
+
heapWatchSink.attach({
|
|
420711
|
+
info: (line) => {
|
|
420712
|
+
heapWatchLogger.info(line);
|
|
420713
|
+
},
|
|
420714
|
+
warn: (line) => {
|
|
420715
|
+
heapWatchLogger.warn(line);
|
|
420716
|
+
}
|
|
420717
|
+
});
|
|
420667
420718
|
const addonRouteRegistry = new system_1.AddonRouteRegistry();
|
|
420668
420719
|
const dataPlaneRegistry = new system_1.DataPlaneRegistry();
|
|
420669
420720
|
const { NotificationServiceWrapper } = await Promise.resolve().then(() => __importStar(require_notification_wrapper_service()));
|