Files
HarborForge.OpenclawPlugin/plugin/core/live-config.js
2026-03-21 19:22:57 +00:00

32 lines
1.2 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getLivePluginConfig = getLivePluginConfig;
function getLivePluginConfig(api, fallback) {
const root = api.config || {};
const plugins = root.plugins || {};
const entries = plugins.entries || {};
const entry = entries['harbor-forge'] || {};
const cfg = entry.config || {};
if (Object.keys(cfg).length > 0 || Object.keys(entry).length > 0) {
const monitorPort = typeof cfg.monitor_port === 'number'
? cfg.monitor_port
: typeof cfg.monitorPort === 'number'
? cfg.monitorPort
: typeof fallback.monitor_port === 'number'
? fallback.monitor_port
: fallback.monitorPort;
return {
...fallback,
...cfg,
monitor_port: monitorPort,
monitorPort,
enabled: typeof cfg.enabled === 'boolean'
? cfg.enabled
: typeof entry.enabled === 'boolean'
? entry.enabled
: fallback.enabled,
};
}
return fallback;
}
//# sourceMappingURL=live-config.js.map